Browse Source

修改出库后退库功能

lwx_dev
erdanergou 3 years ago
parent
commit
530c342146
  1. 5
      src/main/java/com/dreamchaser/depository_manage/entity/ApplicationOutRecord.java
  2. 6
      src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml
  3. 26
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  4. 20
      src/test/java/com/dreamchaser/depository_manage/TestForOther.java

5
src/main/java/com/dreamchaser/depository_manage/entity/ApplicationOutRecord.java

@ -180,6 +180,11 @@ public class ApplicationOutRecord {
*/ */
private String outType; private String outType;
/**
* 最后修改人员
*/
private String editUser;

6
src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml

@ -118,6 +118,7 @@
<result column="aorconstructionunitid" property="constructionUnitId" jdbcType="INTEGER"/> <result column="aorconstructionunitid" property="constructionUnitId" jdbcType="INTEGER"/>
<result column="aoradminorgid" property="adminorgId" jdbcType="INTEGER"/> <result column="aoradminorgid" property="adminorgId" jdbcType="INTEGER"/>
<result column="outTime" property="outTime" jdbcType="INTEGER"/> <result column="outTime" property="outTime" jdbcType="INTEGER"/>
<result column="editUser" property="editUser" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
@ -171,7 +172,7 @@
<sql id="ApplicationOutRecordInfo"> <sql id="ApplicationOutRecordInfo">
aorid,mid,mname,depositoryId,dname,applicantId,applicantTime,applyRemark,aorcode,aorpirce,aorquantity,departmenthead,departmentheadPass,departmentHeadTime,departmentheadMessage, aorid,mid,mname,depositoryId,dname,applicantId,applicantTime,applyRemark,aorcode,aorpirce,aorquantity,departmenthead,departmentheadPass,departmentHeadTime,departmentheadMessage,
depositoryManager,depositoryManagerPass,depositoryManagerTime,depositoryManagerMessage,aorstate,istransfer,mcode,placeId,pass,aormUnit,aorconstructionunitid,aoradminorgid,cuname, depositoryManager,depositoryManagerPass,depositoryManagerTime,depositoryManagerMessage,aorstate,istransfer,mcode,placeId,pass,aormUnit,aorconstructionunitid,aoradminorgid,cuname,
cuintroduce,cuaddress,outTime,abstract,outType cuintroduce,cuaddress,outTime,abstract,outType,editUser
</sql> </sql>
<sql id="ApplicationOutRecordMinInfo"> <sql id="ApplicationOutRecordMinInfo">
@ -1458,6 +1459,9 @@
<if test="outType != null and outType != ''"> <if test="outType != null and outType != ''">
outType = #{outType}, outType = #{outType},
</if> </if>
<if test="editUser != null and editUser != ''">
editUser = #{editUser},
</if>
<if test="pass != null and pass != ''"> <if test="pass != null and pass != ''">
pass = #{pass} pass = #{pass}
</if> </if>

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

@ -1859,7 +1859,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
Map<String, Object> paramForUpdateSplitInventory = new HashMap<>(); Map<String, Object> paramForUpdateSplitInventory = new HashMap<>();
paramForUpdateSplitInventory.put("placeId", outRecordMin.getPlaceId()); paramForUpdateSplitInventory.put("placeId", outRecordMin.getPlaceId());
paramForUpdateSplitInventory.put("depositoryId", outRecordMin.getDepositoryId()); paramForUpdateSplitInventory.put("depositoryId", outRecordMin.getDepositoryId());
paramForUpdateSplitInventory.put("quantity", returnQuantity); paramForUpdateSplitInventory.put("quantity", String.valueOf(returnQuantity));
paramForUpdateSplitInventory.put("mid", inventoryById.getMid()); paramForUpdateSplitInventory.put("mid", inventoryById.getMid());
paramForUpdateSplitInventory.put("unit", unit); paramForUpdateSplitInventory.put("unit", unit);
paramForUpdateSplitInventory.put("code", inventoryById.getCode()); paramForUpdateSplitInventory.put("code", inventoryById.getCode());
@ -1900,7 +1900,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
Map<String, Object> paramForUpdateSplitInventory = new HashMap<>(); Map<String, Object> paramForUpdateSplitInventory = new HashMap<>();
paramForUpdateSplitInventory.put("placeId", outRecordMin.getPlaceId()); paramForUpdateSplitInventory.put("placeId", outRecordMin.getPlaceId());
paramForUpdateSplitInventory.put("depositoryId", outRecordMin.getDepositoryId()); paramForUpdateSplitInventory.put("depositoryId", outRecordMin.getDepositoryId());
paramForUpdateSplitInventory.put("quantity", returnQuantity); paramForUpdateSplitInventory.put("quantity", String.valueOf(returnQuantity));
paramForUpdateSplitInventory.put("mid", inventoryById.getMid()); paramForUpdateSplitInventory.put("mid", inventoryById.getMid());
paramForUpdateSplitInventory.put("unit", unit); paramForUpdateSplitInventory.put("unit", unit);
paramForUpdateSplitInventory.put("code", inventoryById.getCode()); paramForUpdateSplitInventory.put("code", inventoryById.getCode());
@ -1928,7 +1928,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
materialMapper.updateInventory(inventoryById); materialMapper.updateInventory(inventoryById);
// 强行完成出库 // 强行完成出库
updateApplicationMinOutInfo(id, outRecordMin, outRecord, (double) (quantity / 100), userToken, placeById.getId(), userAgent);
// 获取当前出库人员
UserByPort userByPort = LinkInterfaceUtil.FindUserById(outRecordMin.getCheckId(), userToken);
outRecord.setPass(1);
updateApplicationMinOutInfo(id, outRecordMin, outRecord, (double) (quantity / 100), userByPort, placeById.getId(), userAgent);
} }
@ -1978,7 +1983,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
result = depositoryRecordMapper.updateApplicationOutRecordMin(outRecordMin); result = depositoryRecordMapper.updateApplicationOutRecordMin(outRecordMin);
} }
} else { }
else {
// 如果未开始出库的 // 如果未开始出库的
// 设置新数量 // 设置新数量
@ -2004,7 +2010,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
outRecord.setPrice(outRecord.getPrice() - inventoryById.getPrice() * (outQuantity / 100) + inventoryById.getPrice() * quantity); outRecord.setPrice(outRecord.getPrice() - inventoryById.getPrice() * (outQuantity / 100) + inventoryById.getPrice() * quantity);
} }
} else { }
else {
// 如果是拆单单位 // 如果是拆单单位
if (inventoryById.getPrice() != null) { if (inventoryById.getPrice() != null) {
@ -2027,6 +2034,15 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
} }
outRecord.setEditUser(userToken.getId().toString());
Map<String,Object> updateOutRecord = new HashMap<>();
updateOutRecord.put("id",outRecord.getId());
updateOutRecord.put("price",outRecord.getPrice());
updateOutRecord.put("editUser",outRecord.getEditUser());
updateOutRecord.put("pass",outRecord.getPass());
depositoryRecordMapper.updateApplicationOutRecord(updateOutRecord);
return result; return result;
} }

20
src/test/java/com/dreamchaser/depository_manage/TestForOther.java

@ -50,17 +50,7 @@ public class TestForOther {
@Autowired @Autowired
DepositoryRecordService depositoryRecordService; DepositoryRecordService depositoryRecordService;
@Autowired
DepositoryRecordMapper depositoryRecordMapper;
@Autowired
ExcelService excelService;
@Autowired
MaterialMapper materialMapper;
@Autowired
QyWxOperationService qyWxOperationService;
/** /**
* 获取当月的开始和结束时间 * 获取当月的开始和结束时间
@ -69,11 +59,11 @@ public class TestForOther {
@Test @Test
public void run() { public void run() {
ApprovalInfo_Details approvalInfo = new ApprovalInfo_Details(); // ApprovalInfo_Details approvalInfo = new ApprovalInfo_Details();
ApprovalInfo_Details_Approver approver = new ApprovalInfo_Details_Approver(); // ApprovalInfo_Details_Approver approver = new ApprovalInfo_Details_Approver();
approver.setUserId("PangFuZhen"); // approver.setUserId("PangFuZhen");
approvalInfo.setApprover(approver); // approvalInfo.setApprover(approver);
depositoryRecordService.reviewByQyWxApprovalOut("1",approvalInfo,"0f2162ca5229a3e68468c6e9ab957542","2","202303290021", false,2); // depositoryRecordService.reviewByQyWxApprovalOut("1",approvalInfo,"599076aa8e931b27af7935eb69db4243","2","202303290034", false,2);
// depositoryRecordService.reviewByQyWxApprovalIn("[1]",approvalInfo,"460f46eaefb46bb0c171029f62e2cea6","2","202303220009"); // depositoryRecordService.reviewByQyWxApprovalIn("[1]",approvalInfo,"460f46eaefb46bb0c171029f62e2cea6","2","202303220009");
// UserByPort userByPort = LinkInterfaceUtil.FindUserById(78, null); // UserByPort userByPort = LinkInterfaceUtil.FindUserById(78, null);
// List<String> s = excelService.writeExcelForPrint(2, 4,userByPort); // List<String> s = excelService.writeExcelForPrint(2, 4,userByPort);

Loading…
Cancel
Save