Browse Source

完成组合出库

lwx_dev
erdanergou 3 years ago
parent
commit
eb31c17f11
  1. 16
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java
  2. 98
      src/main/java/com/dreamchaser/depository_manage/controller/PageController.java
  3. 3
      src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml
  4. 6
      src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordMinP.java
  5. 30
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  6. 2
      src/main/resources/templates/pages/application/application-out_min-mobile.html
  7. 4
      src/main/resources/templates/pages/application/form-step-look_minRecordOut.html
  8. 12
      src/main/resources/templates/pages/depository/table-stock.html
  9. 8
      src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html
  10. 3
      target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml
  11. 12
      target/classes/templates/pages/depository/table-stock.html
  12. 8
      target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html

16
src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java

@ -751,7 +751,7 @@ public class DepositoryRecordController {
}).start();*/ }).start();*/
// 开启一个线程开启审批 // 开启一个线程开启审批
new Thread(new Runnable() { /*new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
JSONObject jsonObject = qyWxOperationService.sendOutApprovalTemplate(crypt, userToken, ObjectFormatUtil.toInteger(id)); JSONObject jsonObject = qyWxOperationService.sendOutApprovalTemplate(crypt, userToken, ObjectFormatUtil.toInteger(id));
@ -763,7 +763,7 @@ public class DepositoryRecordController {
// 设置过期为7天 // 设置过期为7天
redisTemplateForHash.expire(sp_no, 7, TimeUnit.DAYS); redisTemplateForHash.expire(sp_no, 7, TimeUnit.DAYS);
} }
}).start(); }).start();*/
} else if (params.size() > 0) { } else if (params.size() > 0) {
for (int i = 0; i < params.size(); i++) { for (int i = 0; i < params.size(); i++) {
@ -804,7 +804,7 @@ public class DepositoryRecordController {
} }
}).start();*/ }).start();*/
// 开启一个线程开启审批 // 开启一个线程开启审批
new Thread(new Runnable() { /*new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
JSONObject jsonObject = qyWxOperationService.sendOutApprovalTemplate(crypt, userToken, ObjectFormatUtil.toInteger(id)); JSONObject jsonObject = qyWxOperationService.sendOutApprovalTemplate(crypt, userToken, ObjectFormatUtil.toInteger(id));
@ -816,7 +816,7 @@ public class DepositoryRecordController {
// 设置过期为7天 // 设置过期为7天
redisTemplateForHash.expire(sp_no, 7, TimeUnit.DAYS); redisTemplateForHash.expire(sp_no, 7, TimeUnit.DAYS);
} }
}).start(); }).start();*/
} }
if (params.size() < 1) { if (params.size() < 1) {
@ -1001,7 +1001,7 @@ public class DepositoryRecordController {
// 开启一个线程开启审批 // 开启一个线程开启审批
new Thread(new Runnable() { /*new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
JSONObject jsonObject = qyWxOperationService.sendOutApprovalTemplate(crypt, userToken, ObjectFormatUtil.toInteger(id)); JSONObject jsonObject = qyWxOperationService.sendOutApprovalTemplate(crypt, userToken, ObjectFormatUtil.toInteger(id));
@ -1013,7 +1013,7 @@ public class DepositoryRecordController {
// 设置过期为7天 // 设置过期为7天
redisTemplateForHash.expire(sp_no, 7, TimeUnit.DAYS); redisTemplateForHash.expire(sp_no, 7, TimeUnit.DAYS);
} }
}).start(); }).start();*/
} }
} }
@ -1194,7 +1194,7 @@ public class DepositoryRecordController {
}).start();*/ }).start();*/
// 开启一个线程开启审批 /* // 开启一个线程开启审批
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -1207,7 +1207,7 @@ public class DepositoryRecordController {
// 设置过期为7天 // 设置过期为7天
redisTemplateForHash.expire(sp_no, 7, TimeUnit.DAYS); redisTemplateForHash.expire(sp_no, 7, TimeUnit.DAYS);
} }
}).start(); }).start();*/
} }
if (success == 0) { if (success == 0) {

98
src/main/java/com/dreamchaser/depository_manage/controller/PageController.java

@ -1255,7 +1255,7 @@ public class PageController {
for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutRecordMinByParent) { for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutRecordMinByParent) {
// 获取子订单信息 // 获取子订单信息
// 获取出库物料信息 // 获取出库物料信息
Inventory materialById = materialService.findInventoryById(applicationOutRecordMin.getMid()); Inventory inventoryById = materialService.findInventoryById(applicationOutRecordMin.getMid());
// 获取出库物料仓库信息 // 获取出库物料仓库信息
Depository depository = depositoryService.findDepositoryById(applicationOutRecordMin.getDepositoryId()); Depository depository = depositoryService.findDepositoryById(applicationOutRecordMin.getDepositoryId());
// 获取出库库位 // 获取出库库位
@ -1263,16 +1263,26 @@ public class PageController {
if (placeById != null) { if (placeById != null) {
placeCode.append(placeById.getCode()).append(","); placeCode.append(placeById.getCode()).append(",");
} }
mname.append(materialById.getMname()).append(","); mname.append(inventoryById.getMname()).append(",");
mcode.append(materialById.getCode()).append(","); mcode.append(inventoryById.getCode()).append(",");
depositoryName.append(depository.getDname()).append(","); depositoryName.append(depository.getDname()).append(",");
sumQuantity += applicationOutRecordMin.getQuantity(); sumQuantity += applicationOutRecordMin.getQuantity();
sumPrice += (materialById.getPrice());
String unit = applicationOutRecordMin.getUnit(); String unit = applicationOutRecordMin.getUnit();
if ("-1".equals(unit)) { if ("-1".equals(unit)) {
sumUnit.append(materialById.getUnit() + ","); sumPrice += (inventoryById.getPrice() * applicationOutRecordMin.getQuantity());
sumUnit.append(inventoryById.getUnit()).append(",");
} else { } else {
sumUnit.append(unit + ","); // 用于获取当前拆单记录
Map<String,Object> paramForSplitInfo = new HashMap<>();
paramForSplitInfo.put("newUnit",unit);
paramForSplitInfo.put("mid",inventoryById.getMid());
// 获取拆单记录
SplitInfo splitInfo = splitUnitService.findSplitInfoByMidAndUnit(paramForSplitInfo);
// 获取当前拆单与基础单位的进制
int scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1);
sumUnit.append(unit).append(",");
sumPrice+= (inventoryById.getPrice() / scale * applicationOutRecordMin.getQuantity());
} }
} }
// 申请人 // 申请人
@ -1281,8 +1291,8 @@ public class PageController {
String departmentheads = recordP.getDepartmenthead(); String departmentheads = recordP.getDepartmenthead();
String[] split = departmentheads.split(","); String[] split = departmentheads.split(",");
StringBuilder departmentHeadName = new StringBuilder(); StringBuilder departmentHeadName = new StringBuilder();
for (int i = 0; i < split.length; i++) { for (String value : split) {
UserByPort departmenthead = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(split[i]), userToken); UserByPort departmenthead = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(value), userToken);
departmentHeadName.append(departmenthead.getName()).append(","); departmentHeadName.append(departmenthead.getName()).append(",");
} }
@ -1327,7 +1337,6 @@ public class PageController {
applicationInRecordPById.setApplicantName(userByPort.getName()); applicationInRecordPById.setApplicantName(userByPort.getName());
applicationInRecordPById.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationInRecordPById.getApplicantTime()))); applicationInRecordPById.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationInRecordPById.getApplicantTime())));
applicationInRecordPById.setPrice(applicationInRecordPById.getPrice() / 100); applicationInRecordPById.setPrice(applicationInRecordPById.getPrice() / 100);
mv.addObject("record", applicationInRecordPById); mv.addObject("record", applicationInRecordPById);
} else { } else {
throw new MyException("缺少必要参数!"); throw new MyException("缺少必要参数!");
@ -1343,9 +1352,10 @@ public class PageController {
if (id != null) { if (id != null) {
// 获取当前子订单 // 获取当前子订单
ApplicationOutRecordMin recordMin = depositoryRecordService.findApplicationOutMinById(id); ApplicationOutRecordMin recordMin = depositoryRecordService.findApplicationOutMinById(id);
ApplicationOutRecordMinP recordMinP = new ApplicationOutRecordMinP(recordMin); ApplicationOutRecordMinP recordMinP = new ApplicationOutRecordMinP(recordMin);
// 获取出库物料信息 // 获取出库物料信息
Inventory materialById = materialService.findInventoryById(recordMin.getMid()); Inventory inventoryById = materialService.findInventoryById(recordMin.getMid());
// 获取出库物料仓库信息 // 获取出库物料仓库信息
Depository depository = depositoryService.findDepositoryById(recordMin.getDepositoryId()); Depository depository = depositoryService.findDepositoryById(recordMin.getDepositoryId());
// 获取出库库位 // 获取出库库位
@ -1355,13 +1365,30 @@ public class PageController {
// 设置处理人姓名 // 设置处理人姓名
recordMinP.setCheckerName(userByPort.getName()); recordMinP.setCheckerName(userByPort.getName());
recordMinP.setDepositoryName(depository.getDname()); recordMinP.setDepositoryName(depository.getDname());
recordMinP.setMname(materialById.getMname()); recordMinP.setMname(inventoryById.getMname());
recordMinP.setMcode(materialById.getCode()); recordMinP.setMcode(inventoryById.getCode());
recordMinP.setPlaceCode(placeById.getCode()); recordMinP.setPlaceCode(placeById.getCode());
Double price = (materialById.getPrice()) * recordMinP.getQuantity(); String unit = recordMinP.getUnit();
BigDecimal bg = new BigDecimal(price); if("-1".equals(unit)){
price = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); recordMinP.setUnit(inventoryById.getUnit());
recordMinP.setPrice(price); double price = (inventoryById.getPrice()) * recordMinP.getQuantity();
BigDecimal bg = new BigDecimal(price);
price = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
recordMinP.setPrice(price);
}else{
// 用于获取拆单记录
Map<String,Object> paramForSplitInfo = new HashMap<>();
paramForSplitInfo.put("newUnit",unit);
paramForSplitInfo.put("mid",inventoryById.getMid());
// 获取拆单记录
SplitInfo splitInfo = splitUnitService.findSplitInfoByMidAndUnit(paramForSplitInfo);
// 获取当前拆单与基础单位的进制
int scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1);
double price = (inventoryById.getPrice()) / scale * recordMinP.getQuantity();
BigDecimal bg = new BigDecimal(price);
price = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
recordMinP.setPrice(price);
}
mv.addObject("recordMinP", recordMinP); mv.addObject("recordMinP", recordMinP);
} else { } else {
throw new MyException("缺少必要参数!"); throw new MyException("缺少必要参数!");
@ -1399,14 +1426,13 @@ public class PageController {
List<ApplicationOutRecordMinP> recordMinPList = new ArrayList<>(); List<ApplicationOutRecordMinP> recordMinPList = new ArrayList<>();
// 当前总额 // 当前总额
Double sumPrice = 0.0; Double sumPrice = 0.0;
for (int i = 0; i < applicationOutRecordMinByParent.size(); i++) { for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutRecordMinByParent) {
// 获取子订单信息 // 获取子订单信息
ApplicationOutRecordMin applicationOutRecordMin = applicationOutRecordMinByParent.get(i);
// 获取输出子订单信息 // 获取输出子订单信息
ApplicationOutRecordMinP recordMinP = new ApplicationOutRecordMinP(applicationOutRecordMin); ApplicationOutRecordMinP recordMinP = new ApplicationOutRecordMinP(applicationOutRecordMin);
// 获取出库物料信息 // 获取出库物料信息
Inventory materialById = materialService.findInventoryById(applicationOutRecordMin.getMid()); Inventory inventoryById = materialService.findInventoryById(applicationOutRecordMin.getMid());
// 获取出库物料仓库信息 // 获取出库物料仓库信息
Depository depository = depositoryService.findDepositoryById(applicationOutRecordMin.getDepositoryId()); Depository depository = depositoryService.findDepositoryById(applicationOutRecordMin.getDepositoryId());
// 获取出库库位 // 获取出库库位
@ -1414,7 +1440,7 @@ public class PageController {
if (placeById != null) { if (placeById != null) {
placeCode.append(placeById.getCode()).append(","); placeCode.append(placeById.getCode()).append(",");
} }
recordMinP.setMname(materialById.getMname()); recordMinP.setMname(inventoryById.getMname());
recordMinP.setDepositoryName(depository.getDname()); recordMinP.setDepositoryName(depository.getDname());
recordMinP.setPlaceCode(placeById.getCode()); recordMinP.setPlaceCode(placeById.getCode());
Integer checkId = applicationOutRecordMin.getCheckId(); Integer checkId = applicationOutRecordMin.getCheckId();
@ -1428,12 +1454,30 @@ public class PageController {
outDisposer.append("暂未处理,"); outDisposer.append("暂未处理,");
recordMinP.setCheckerName("暂未处理"); recordMinP.setCheckerName("暂未处理");
} }
mname.append(materialById.getMname()).append(",");
mcode.append(materialById.getCode()).append(","); mname.append(inventoryById.getMname()).append(",");
mcode.append(inventoryById.getCode()).append(",");
depositoryName.append(depository.getDname()).append(","); depositoryName.append(depository.getDname()).append(",");
quantityByMaterial.append(applicationOutRecordMin.getQuantity() + ","); quantityByMaterial.append(applicationOutRecordMin.getQuantity()).append(",");
sumQuantity += applicationOutRecordMin.getQuantity(); sumQuantity += applicationOutRecordMin.getQuantity();
sumPrice += (materialById.getPrice() * applicationOutRecordMin.getQuantity()); // 获取当前计量单位
String unit = recordMinP.getUnit();
if("-1".equals(unit)){
// 如果是基础单位
sumPrice += (inventoryById.getPrice() * applicationOutRecordMin.getQuantity());
}else{
// 如果是拆单
// 用于获取拆单记录
Map<String,Object> paramForSplitInfo = new HashMap<>();
paramForSplitInfo.put("newUnit",unit);
paramForSplitInfo.put("mid",inventoryById.getMid());
// 查询拆单记录
SplitInfo splitInfo = splitUnitService.findSplitInfoByMidAndUnit(paramForSplitInfo);
// 获取当前拆单记录与基础单位的进制
int scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1);
sumPrice += (inventoryById.getPrice() / scale * applicationOutRecordMin.getQuantity());
}
recordMinPList.add(recordMinP); recordMinPList.add(recordMinP);
} }
// 申请人 // 申请人
@ -1457,16 +1501,16 @@ public class PageController {
depositoryManagerId = manager.split(","); depositoryManagerId = manager.split(",");
} }
List<UserByPort> depositoryManager = new ArrayList<>(); List<UserByPort> depositoryManager = new ArrayList<>();
String depositoryManagerNames = ""; StringBuilder depositoryManagerNames = new StringBuilder();
for (int i = 0; i < depositoryManagerId.length; i++) { for (int i = 0; i < depositoryManagerId.length; i++) {
Integer managerid = ObjectFormatUtil.toInteger(depositoryManagerId[i]); Integer managerid = ObjectFormatUtil.toInteger(depositoryManagerId[i]);
UserByPort user = LinkInterfaceUtil.FindUserById(managerid, userToken); UserByPort user = LinkInterfaceUtil.FindUserById(managerid, userToken);
depositoryManager.add(user); depositoryManager.add(user);
depositoryManagerNames += user.getName(); depositoryManagerNames.append(user.getName());
} }
applicationOutRecordPById.setApplicantName(userByPort.getName()); applicationOutRecordPById.setApplicantName(userByPort.getName());
applicationOutRecordPById.setDepartmentheadName(departmentHeadName.toString()); applicationOutRecordPById.setDepartmentheadName(departmentHeadName.toString());
applicationOutRecordPById.setDepositoryManagerName(depositoryManagerNames); applicationOutRecordPById.setDepositoryManagerName(depositoryManagerNames.toString());
applicationOutRecordPById.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationOutRecordPById.getApplicantTime()))); applicationOutRecordPById.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationOutRecordPById.getApplicantTime())));
applicationOutRecordPById.setDepartmentheadTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationOutRecordPById.getDepartmentheadTime()))); applicationOutRecordPById.setDepartmentheadTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationOutRecordPById.getDepartmentheadTime())));
applicationOutRecordPById.setDepositoryManagerTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationOutRecordPById.getDepositoryManagerTime()))); applicationOutRecordPById.setDepositoryManagerTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationOutRecordPById.getDepositoryManagerTime())));

3
src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml

@ -931,6 +931,9 @@
<if test="amounts != null and amounts != ''"> <if test="amounts != null and amounts != ''">
amounts = #{amounts}, amounts = #{amounts},
</if> </if>
<if test="numberOfTemporary != null">
number_of_temporary = #{numberOfTemporary}
</if>
</set> </set>
WHERE id = #{id} WHERE id = #{id}
</update> </update>

6
src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordMinP.java

@ -87,6 +87,11 @@ public class ApplicationOutRecordMinP {
*/ */
private Integer state; private Integer state;
/**
* 出库物料的单位
*/
private String unit;
public ApplicationOutRecordMinP(ApplicationOutRecordMin recordMin) { public ApplicationOutRecordMinP(ApplicationOutRecordMin recordMin) {
this.id = recordMin.getId(); this.id = recordMin.getId();
@ -98,5 +103,6 @@ public class ApplicationOutRecordMinP {
this.state = recordMin.getState(); this.state = recordMin.getState();
this.parentId = recordMin.getParentId(); this.parentId = recordMin.getParentId();
this.placeId = recordMin.getPlaceId(); this.placeId = recordMin.getPlaceId();
this.unit = recordMin.getUnit();
} }
} }

30
src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

@ -688,7 +688,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 获取出库数量 // 获取出库数量
Integer quantity = ObjectFormatUtil.toInteger(map.get("quantity")); Integer quantity = ObjectFormatUtil.toInteger(map.get("quantity"));
// 设置当前暂时出库数量 // 设置当前暂时出库数量
inventoryById.setNumberOfTemporary(quantity); inventoryById.setNumberOfTemporary(inventoryById.getNumberOfTemporary() + quantity);
// 修改库存记录 // 修改库存记录
materialMapper.updateInventory(inventoryById); materialMapper.updateInventory(inventoryById);
return depositoryRecordMapper.insertApplicationOutRecordMin(map); return depositoryRecordMapper.insertApplicationOutRecordMin(map);
@ -1778,7 +1778,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}).start();*/ }).start();*/
} }
for (int i = 0; i < depositoryIdList.size(); i++) { /*for (int i = 0; i < depositoryIdList.size(); i++) {
Object o = minIdByDepository.get("depository" + depositoryIdList.get(i)); Object o = minIdByDepository.get("depository" + depositoryIdList.get(i));
if (o != null) { if (o != null) {
List<Integer> minIdList = (List<Integer>) o; List<Integer> minIdList = (List<Integer>) o;
@ -1805,7 +1805,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
} else { } else {
continue; continue;
} }
} }*/
// 将主订单插入到redis中 // 将主订单插入到redis中
redisTemplate.opsForHash().put("record:" + recordP.getId(), "minRecord", minRecordByMain.toString()); redisTemplate.opsForHash().put("record:" + recordP.getId(), "minRecord", minRecordByMain.toString());
@ -1995,7 +1995,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
QyWxUid.append("PangFuZhen,"); QyWxUid.append("PangFuZhen,");
map.put("depositoryManager", depositoryManager.toString()); map.put("depositoryManager", depositoryManager.toString());
// 向仓储中心负责人发送新的消息 // 向仓储中心负责人发送新的消息
new Thread(new Runnable() { /*new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
JSONObject jsonObject = qyWxOperationService.sendQyWxToApplicationOutMessage(QyWxUid.toString(), ObjectFormatUtil.toInteger(id), false, userAgent); JSONObject jsonObject = qyWxOperationService.sendQyWxToApplicationOutMessage(QyWxUid.toString(), ObjectFormatUtil.toInteger(id), false, userAgent);
@ -2009,7 +2009,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 设置过期时间为三天 // 设置过期时间为三天
redisTemplate.expire("user:" + userToken.getNumber() + ":QyWxOutId:" + id, 72, TimeUnit.HOURS); redisTemplate.expire("user:" + userToken.getNumber() + ":QyWxOutId:" + id, 72, TimeUnit.HOURS);
} }
}).start(); }).start();*/
} }
@ -2023,7 +2023,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 开启线程更改其他用户卡片模板样式 // 开启线程更改其他用户卡片模板样式
String finalResult = result; String finalResult = result;
new Thread(new Runnable() { /*new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
// 获取responseCode(key为申请人number) // 获取responseCode(key为申请人number)
@ -2054,7 +2054,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
s = "PangFuZhen,"; s = "PangFuZhen,";
qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toInteger(id), s, userAgent, 1); qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toInteger(id), s, userAgent, 1);
} }
}).start(); }).start();*/
} else { } else {
String result = ""; String result = "";
// 开启线程更改其他用户卡片模板样式 // 开启线程更改其他用户卡片模板样式
@ -2211,7 +2211,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
} }
// 开启线程更改其他用户卡片模板样式 // 开启线程更改其他用户卡片模板样式
String finalResult = result; String finalResult = result;
new Thread(new Runnable() { /*new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
// 获取responseCode(key为申请人number) // 获取responseCode(key为申请人number)
@ -2221,7 +2221,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
String responseCode = (String) redisTemplate.opsForHash().get(key, "responseCode"); String responseCode = (String) redisTemplate.opsForHash().get(key, "responseCode");
qyWxOperationService.updateTemplateCard(responseCode, userToken.getName(), finalResult, userAgent); qyWxOperationService.updateTemplateCard(responseCode, userToken.getName(), finalResult, userAgent);
} }
}).start(); }).start();*/
} }
@ -2280,7 +2280,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
} }
QyWxUid.append("PangFuZhen" + ","); QyWxUid.append("PangFuZhen" + ",");
map.put("depositoryManager", depositoryManager.toString()); map.put("depositoryManager", depositoryManager.toString());
// 向仓储中心负责人发送新的消息 /*// 向仓储中心负责人发送新的消息
JSONObject jsonObject = qyWxOperationService.sendQyWxToApplicationOutMessage(QyWxUid.toString(), ObjectFormatUtil.toInteger(outId), false, userAgent); JSONObject jsonObject = qyWxOperationService.sendQyWxToApplicationOutMessage(QyWxUid.toString(), ObjectFormatUtil.toInteger(outId), false, userAgent);
// 将当前返回结果保存到redis中 // 将当前返回结果保存到redis中
Map<String, Object> QyWxMessageMap = new HashMap<>(); Map<String, Object> QyWxMessageMap = new HashMap<>();
@ -2289,7 +2289,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// key user:300450:QyWxOut:1 // key user:300450:QyWxOut:1
redisTemplate.opsForHash().putAll("user:" + userByPort.getNumber() + ":QyWxOutId:" + outId, QyWxMessageMap); redisTemplate.opsForHash().putAll("user:" + userByPort.getNumber() + ":QyWxOutId:" + outId, QyWxMessageMap);
// 设置过期时间为三天 // 设置过期时间为三天
redisTemplate.expire("user:" + userByPort.getNumber() + ":QyWxOutId:" + outId, 72, TimeUnit.HOURS); redisTemplate.expire("user:" + userByPort.getNumber() + ":QyWxOutId:" + outId, 72, TimeUnit.HOURS);*/
} else { } else {
updateInventoryForOutRefused(recordP); updateInventoryForOutRefused(recordP);
// 如果点击的是驳回 // 如果点击的是驳回
@ -2375,16 +2375,16 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
minRecord.put("manager", minRecordManage.toString()); minRecord.put("manager", minRecordManage.toString());
// 添加子订单到redis中 // 添加子订单到redis中
redisTemplate.opsForHash().putAll(minRecordKey, minRecord); redisTemplate.opsForHash().putAll(minRecordKey, minRecord);
// 开启线程向仓库管理员发送消息 /*// 开启线程向仓库管理员发送消息
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
JSONObject jsonObject = qyWxOperationService.sendNotificationToDepositoryManager(QyWxUid.toString(), applicationOutRecordMin.getId(), userAgent); JSONObject jsonObject = qyWxOperationService.sendNotificationToDepositoryManager(QyWxUid.toString(), applicationOutRecordMin.getId(), userAgent);
} }
}).start(); }).start();*/
} }
for (int i = 0; i < depositoryIdList.size(); i++) { /*for (int i = 0; i < depositoryIdList.size(); i++) {
Object o = minIdByDepository.get("depository" + depositoryIdList.get(i)); Object o = minIdByDepository.get("depository" + depositoryIdList.get(i));
if (o != null) { if (o != null) {
List<Integer> minIdList = (List<Integer>) o; List<Integer> minIdList = (List<Integer>) o;
@ -2411,7 +2411,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
} else { } else {
continue; continue;
} }
} }*/
// 将主订单插入到redis中 // 将主订单插入到redis中
redisTemplate.opsForHash().put("record:" + recordP.getId(), "minRecord", minRecordByMain.toString()); redisTemplate.opsForHash().put("record:" + recordP.getId(), "minRecord", minRecordByMain.toString());
map.put("state", "仓储中心负责人审核通过"); map.put("state", "仓储中心负责人审核通过");

2
src/main/resources/templates/pages/application/application-out_min-mobile.html

@ -91,7 +91,7 @@
lis.push('<div class="layui-col-md4 my-card-context">' + lis.push('<div class="layui-col-md4 my-card-context">' +
'<h4> 物料名称:' + data[i].mname + '</h4>' + '<h4> 物料名称:' + data[i].mname + '</h4>' +
'<h4> 物料编码:' + data[i].mcode + '</h4>' + '<h4> 物料编码:' + data[i].mcode + '</h4>' +
'<h4> 出库数量:' + data[i].showQuantity + '</h4>' + '<h4> 出库数量:' + data[i].quantity + '</h4>' +
'<h4> 处理人:' + data[i].checkerName + '</h4>' + '<h4> 处理人:' + data[i].checkerName + '</h4>' +
'<h4> 生产日期:' + producedDate+ '</h4>' + '<h4> 生产日期:' + producedDate+ '</h4>' +
'<h4> 所处库位:' + data[i].pcode + '</h4>' + '<h4> 所处库位:' + data[i].pcode + '</h4>' +

4
src/main/resources/templates/pages/application/form-step-look_minRecordOut.html

@ -42,6 +42,10 @@
<td>数量</td> <td>数量</td>
<td id="quantity" th:text="${recordMinP.getQuantity()}">409</td> <td id="quantity" th:text="${recordMinP.getQuantity()}">409</td>
</tr> </tr>
<tr>
<td>单位</td>
<td id="unit" th:text="${recordMinP.getUnit()}">409</td>
</tr>
<tr> <tr>
<td>金额</td> <td>金额</td>
<td id="price" th:text="${recordMinP.getPrice()}">2016-11-28</td> <td id="price" th:text="${recordMinP.getPrice()}">2016-11-28</td>

12
src/main/resources/templates/pages/depository/table-stock.html

@ -370,7 +370,13 @@
clickNum += 1; clickNum += 1;
btn.attr("click_num", clickNum); btn.attr("click_num", clickNum);
let showQuantity = data.showQuantity[newUnit]; let showQuantity = data.showQuantity[newUnit];
obj.update({quantity: showQuantity}); if (showQuantity !== undefined) {
obj.update({quantity: showQuantity});
} else {
obj.update({quantity: 0});
}
} else { } else {
btn.text(data.unit); btn.text(data.unit);
btn.attr("click_num", 0); btn.attr("click_num", 0);
@ -393,7 +399,7 @@
let unitBtn = obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[1]; let unitBtn = obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[1];
let unit = unitBtn.innerText; let unit = unitBtn.innerText;
let click_num = Number(unitBtn.getAttribute("click_num")); let click_num = Number(unitBtn.getAttribute("click_num"));
if(click_num === 0){ if (click_num === 0) {
unit = "-1"; unit = "-1";
} }
var index = layer.open({ var index = layer.open({
@ -403,7 +409,7 @@
maxmin: true, maxmin: true,
shadeClose: true, shadeClose: true,
area: ['70%', '70%'], area: ['70%', '70%'],
content: '/selectPlaceByDepository?depositoryId=' + depositoryId + '&mid=' + mid + '&placeCode=' + placeCode+'&unit='+unit, content: '/selectPlaceByDepository?depositoryId=' + depositoryId + '&mid=' + mid + '&placeCode=' + placeCode + '&unit=' + unit,
success: function (layero, index) { success: function (layero, index) {
var children = layero.children(); var children = layero.children();
var content = $(children[1]); var content = $(children[1]);

8
src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html

@ -54,7 +54,11 @@
var barCode = null; var barCode = null;
layui.$(function () { layui.$(function () {
parent.parent.parent.wx.scanQRCode({ var result = "1610140012736978944";//当needResult为1时返回处理结果
var req = {};
req.qrCode = result;
outboundLogic(req);
/* parent.parent.parent.wx.scanQRCode({
desc: 'scanQRCode desc', desc: 'scanQRCode desc',
needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果,
scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有
@ -73,7 +77,7 @@
} }
}); });*/
}); });

3
target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml

@ -931,6 +931,9 @@
<if test="amounts != null and amounts != ''"> <if test="amounts != null and amounts != ''">
amounts = #{amounts}, amounts = #{amounts},
</if> </if>
<if test="numberOfTemporary != null">
number_of_temporary = #{numberOfTemporary}
</if>
</set> </set>
WHERE id = #{id} WHERE id = #{id}
</update> </update>

12
target/classes/templates/pages/depository/table-stock.html

@ -370,7 +370,13 @@
clickNum += 1; clickNum += 1;
btn.attr("click_num", clickNum); btn.attr("click_num", clickNum);
let showQuantity = data.showQuantity[newUnit]; let showQuantity = data.showQuantity[newUnit];
obj.update({quantity: showQuantity}); if (showQuantity !== undefined) {
obj.update({quantity: showQuantity});
} else {
obj.update({quantity: 0});
}
} else { } else {
btn.text(data.unit); btn.text(data.unit);
btn.attr("click_num", 0); btn.attr("click_num", 0);
@ -393,7 +399,7 @@
let unitBtn = obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[1]; let unitBtn = obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[1];
let unit = unitBtn.innerText; let unit = unitBtn.innerText;
let click_num = Number(unitBtn.getAttribute("click_num")); let click_num = Number(unitBtn.getAttribute("click_num"));
if(click_num === 0){ if (click_num === 0) {
unit = "-1"; unit = "-1";
} }
var index = layer.open({ var index = layer.open({
@ -403,7 +409,7 @@
maxmin: true, maxmin: true,
shadeClose: true, shadeClose: true,
area: ['70%', '70%'], area: ['70%', '70%'],
content: '/selectPlaceByDepository?depositoryId=' + depositoryId + '&mid=' + mid + '&placeCode=' + placeCode+'&unit='+unit, content: '/selectPlaceByDepository?depositoryId=' + depositoryId + '&mid=' + mid + '&placeCode=' + placeCode + '&unit=' + unit,
success: function (layero, index) { success: function (layero, index) {
var children = layero.children(); var children = layero.children();
var content = $(children[1]); var content = $(children[1]);

8
target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html

@ -54,7 +54,11 @@
var barCode = null; var barCode = null;
layui.$(function () { layui.$(function () {
parent.parent.parent.wx.scanQRCode({ var result = "1610140012736978944";//当needResult为1时返回处理结果
var req = {};
req.qrCode = result;
outboundLogic(req);
/* parent.parent.parent.wx.scanQRCode({
desc: 'scanQRCode desc', desc: 'scanQRCode desc',
needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果,
scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有
@ -73,7 +77,7 @@
} }
}); });*/
}); });

Loading…
Cancel
Save