Browse Source

完成入库查询添加单价金额字段

lwx_dev
erdanergou 2 years ago
parent
commit
c27e092ba8
  1. 7
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java
  2. 3
      src/main/java/com/dreamchaser/depository_manage/depository_mapper/DepositoryRecordMapper.xml
  3. 5
      src/main/java/com/dreamchaser/depository_manage/entity/ApplicationInRecord.java
  4. 8
      src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationInRecordP.java
  5. 99
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  6. 35
      src/main/resources/templates/pages/depository/table-in.html

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

@ -908,13 +908,6 @@ public class DepositoryRecordController {
list = depositoryRecordService.findApplicationInRecordPByUser(userToken, map, userKey, token); list = depositoryRecordService.findApplicationInRecordPByUser(userToken, map, userKey, token);
recordPCount = depositoryRecordService.findApplicationInRecordPCountByUser(userToken, map); recordPCount = depositoryRecordService.findApplicationInRecordPCountByUser(userToken, map);
} }
for (ApplicationInRecordP applicationInRecordP : list) {
if (applicationInRecordP.getPrice() != null) {
applicationInRecordP.setPrice(applicationInRecordP.getPrice() / 100);
} else {
applicationInRecordP.setPrice(0.0);
}
}
return new RestResponse(list, recordPCount, 200); return new RestResponse(list, recordPCount, 200);
} }

3
src/main/java/com/dreamchaser/depository_manage/depository_mapper/DepositoryRecordMapper.xml

@ -85,6 +85,7 @@
<result column="airapproverMessage" property="airapproverMessage" jdbcType="VARCHAR"/> <result column="airapproverMessage" property="airapproverMessage" jdbcType="VARCHAR"/>
<result column="mbrand" property="mbrand" jdbcType="VARCHAR"/> <result column="mbrand" property="mbrand" jdbcType="VARCHAR"/>
<result column="pkingdeecode" property="pkingdeecode" jdbcType="VARCHAR"/> <result column="pkingdeecode" property="pkingdeecode" jdbcType="VARCHAR"/>
<result column="mprice" property="mprice" jdbcType="INTEGER"/>
</resultMap> </resultMap>
@ -183,7 +184,7 @@
</sql> </sql>
<sql id="ApplicationInRecordInfo"> <sql id="ApplicationInRecordInfo">
airid,did,airmproducedDate,mname,quantity,price,tname,applicant_time,aircode,dname,applicant_id,applyRemark,mcode,mversion,munit,mtexture,mkingdeecode,mdepositoryCode,airUnit,flagForGroup,mid,airPlaceId,airapproverPass,airapproverTime,airapproverId,airstate,airapproverMessage,airtoGroupId,mbrand,pkingdeecode airid,did,airmproducedDate,mname,mprice,quantity,price,tname,applicant_time,aircode,dname,applicant_id,applyRemark,mcode,mversion,munit,mtexture,mkingdeecode,mdepositoryCode,airUnit,flagForGroup,mid,airPlaceId,airapproverPass,airapproverTime,airapproverId,airstate,airapproverMessage,airtoGroupId,mbrand,pkingdeecode
</sql> </sql>
<sql id="ApplicationOutRecordInfo"> <sql id="ApplicationOutRecordInfo">

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

@ -21,6 +21,11 @@ public class ApplicationInRecord {
* 入库金额 * 入库金额
*/ */
private Double price; private Double price;
/**
* 物料单价
*/
private Integer mprice;
/** /**
* 入库物品类型 * 入库物品类型
*/ */

8
src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationInRecordP.java

@ -1,6 +1,7 @@
package com.dreamchaser.depository_manage.pojo; package com.dreamchaser.depository_manage.pojo;
import com.dreamchaser.depository_manage.entity.ApplicationInRecord; import com.dreamchaser.depository_manage.entity.ApplicationInRecord;
import com.dreamchaser.depository_manage.utils.ObjectFormatUtil;
import lombok.Data; import lombok.Data;
@Data @Data
@ -159,6 +160,10 @@ public class ApplicationInRecordP {
* 物料品牌 * 物料品牌
*/ */
private String mbrand; private String mbrand;
/**
* 物料单价
*/
private Double mprice;
/** /**
@ -169,7 +174,7 @@ public class ApplicationInRecordP {
public ApplicationInRecordP(ApplicationInRecord ar) { public ApplicationInRecordP(ApplicationInRecord ar) {
this.id = ar.getId(); this.id = ar.getId();
this.mname = ar.getMname(); this.mname = ar.getMname();
this.quantity = (double) ar.getQuantity() / 100; this.quantity = ObjectFormatUtil.divide(ar.getQuantity(), 100.0,2);
this.price = ar.getPrice(); this.price = ar.getPrice();
this.materialTypeName = ar.getMaterialTypeName(); this.materialTypeName = ar.getMaterialTypeName();
this.applicantName = ar.getApplicantName(); this.applicantName = ar.getApplicantName();
@ -189,6 +194,7 @@ public class ApplicationInRecordP {
this.airUnit = ar.getAirUnit(); this.airUnit = ar.getAirUnit();
this.flagForGroup = ar.getFlagForGroup(); this.flagForGroup = ar.getFlagForGroup();
this.mid = ar.getMid(); this.mid = ar.getMid();
this.mprice = ObjectFormatUtil.divide(ar.getMprice(),100.0,2);
this.placeId = ar.getPlaceId(); this.placeId = ar.getPlaceId();
this.airtoGroupId = ar.getAirtoGroupId(); this.airtoGroupId = ar.getAirtoGroupId();
this.airapproverPass = ar.getAirapproverPass(); this.airapproverPass = ar.getAirapproverPass();

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

@ -70,7 +70,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
@Autowired @Autowired
private GroupMapper groupMapper; private GroupMapper groupMapper;
@Autowired @Autowired
private UserService userService; private UserService userService;
@ -754,7 +754,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 定义用于获取当前岗位下的人的参数map // 定义用于获取当前岗位下的人的参数map
Map<String, Object> paramForGetUserByPost = new HashMap<>(); Map<String, Object> paramForGetUserByPost = new HashMap<>();
paramForGetUserByPost.put("position", roleAndDepository.getUserId()); paramForGetUserByPost.put("position", roleAndDepository.getUserId());
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost,null,null); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype(); int emptype = userByPort.getEmptype();
if (emptype > 10) { if (emptype > 10) {
@ -776,8 +776,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
flagForApproval = isApprovalPass; flagForApproval = isApprovalPass;
} }
map.put("flagForApproval", flagForApproval); map.put("flagForApproval", flagForApproval);
} } else {
else {
// 设置审批权限 // 设置审批权限
map.put("inType", "mt"); map.put("inType", "mt");
// 获取当前类别物料是否需要审批 // 获取当前类别物料是否需要审批
@ -794,7 +793,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 定义用于获取当前岗位下的人的参数map // 定义用于获取当前岗位下的人的参数map
Map<String, Object> paramForGetUserByPost = new HashMap<>(); Map<String, Object> paramForGetUserByPost = new HashMap<>();
paramForGetUserByPost.put("position", uid); paramForGetUserByPost.put("position", uid);
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost,null,null); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype(); int emptype = userByPort.getEmptype();
if (emptype > 10) { if (emptype > 10) {
@ -1922,7 +1921,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 强行完成出库 // 强行完成出库
// 获取当前出库人员 // 获取当前出库人员
UserByPort userByPort = PublicConfig.FindUserById(outRecordMin.getCheckId(),userKey,token); UserByPort userByPort = PublicConfig.FindUserById(outRecordMin.getCheckId(), userKey, token);
outRecord.setPass(1); outRecord.setPass(1);
updateApplicationMinOutInfo(id, outRecordMin, outRecord, (double) (quantity), userByPort, placeById.getId(), userAgent, userKey, token); updateApplicationMinOutInfo(id, outRecordMin, outRecord, (double) (quantity), userByPort, placeById.getId(), userAgent, userKey, token);
@ -1941,7 +1940,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
for (RoleAndMaterialType mt : materialTypeIdForIn for (RoleAndMaterialType mt : materialTypeIdForIn
) { ) {
// 获取管理员数据 // 获取管理员数据
UserByPort userByPort = PublicConfig.FindUserById(mt.getUid(),userKey,token); UserByPort userByPort = PublicConfig.FindUserById(mt.getUid(), userKey, token);
// 获取用户的用工关系 // 获取用户的用工关系
int emptype = userByPort.getEmptype(); int emptype = userByPort.getEmptype();
if (emptype > 10) { if (emptype > 10) {
@ -1959,7 +1958,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
for (RoleAndDepository mt : materialTypeIdForIn for (RoleAndDepository mt : materialTypeIdForIn
) { ) {
// 获取管理员数据 // 获取管理员数据
UserByPort userByPort = PublicConfig.FindUserById(mt.getUserId(),userKey,token); UserByPort userByPort = PublicConfig.FindUserById(mt.getUserId(), userKey, token);
// 获取用户的用工关系 // 获取用户的用工关系
int emptype = userByPort.getEmptype(); int emptype = userByPort.getEmptype();
if (emptype > 10) { if (emptype > 10) {
@ -2368,7 +2367,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
continue; continue;
} }
Long uid = ObjectFormatUtil.toLong(s); Long uid = ObjectFormatUtil.toLong(s);
UserByPort depositoryManager = PublicConfig.FindUserById(uid,userKey,token); UserByPort depositoryManager = PublicConfig.FindUserById(uid, userKey, token);
// 获取用户的用工关系 // 获取用户的用工关系
int emptype = depositoryManager.getEmptype(); int emptype = depositoryManager.getEmptype();
if (emptype > 10) { if (emptype > 10) {
@ -2818,7 +2817,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
map.put("balancePosterTime", DateUtil.DateTimeToTimeStamp(simpleTime)); map.put("balancePosterTime", DateUtil.DateTimeToTimeStamp(simpleTime));
map.put("balancePoster", userByPort.getId()); map.put("balancePoster", userByPort.getId());
// 获取综合办负责人 // 获取综合办负责人
List<UserByPort> departmentHeadByUser = userService.getDepartmentHeaderByIdForNoPack(268L ); List<UserByPort> departmentHeadByUser = userService.getDepartmentHeaderByIdForNoPack(268L);
StringBuilder departmentId = new StringBuilder(); StringBuilder departmentId = new StringBuilder();
for (UserByPort byPort : departmentHeadByUser) { for (UserByPort byPort : departmentHeadByUser) {
departmentId.append(byPort.getId()).append(","); departmentId.append(byPort.getId()).append(",");
@ -3098,7 +3097,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 获取当前转移物料仓库 // 获取当前转移物料仓库
Depository depositoryRecordById = depositoryMapper.findDepositoryById(material.getDepositoryId()); Depository depositoryRecordById = depositoryMapper.findDepositoryById(material.getDepositoryId());
// Administration company = administrativeService.findAdministrationById(userByPort.getMaindeparment()); // Administration company = administrativeService.findAdministrationById(userByPort.getMaindeparment());
Administration company = PublicConfig.getCompany(userByPort.getMaindeparment(),userKey,token); Administration company = PublicConfig.getCompany(userByPort.getMaindeparment(), userKey, token);
// 生成出库订单 // 生成出库订单
map.put("code", createCode(depositoryRecordById.getDname(), "outOrderNumber", "out", company.getName())); map.put("code", createCode(depositoryRecordById.getDname(), "outOrderNumber", "out", company.getName()));
Object placeId = map.get("fromPlaceId"); Object placeId = map.get("fromPlaceId");
@ -3188,7 +3187,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
List<ApplicationOutRecordMin> minByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(record.getId()); List<ApplicationOutRecordMin> minByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(record.getId());
// 获取申请用户 // 获取申请用户
UserByPort applicantUser = PublicConfig.FindUserById(record.getApplicantId(),userKey,token); UserByPort applicantUser = PublicConfig.FindUserById(record.getApplicantId(), userKey, token);
// 用于标志该仓库是否为前置仓下的仓库 // 用于标志该仓库是否为前置仓下的仓库
boolean flagForHasOtherDepository = true; //默认是前置仓下的仓库 boolean flagForHasOtherDepository = true; //默认是前置仓下的仓库
// 获取当前出库是否为开放出库 // 获取当前出库是否为开放出库
@ -3196,8 +3195,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
int flagForOpenDepository = record.getFlagForOpenDepository(); int flagForOpenDepository = record.getFlagForOpenDepository();
if (manager1 != null && !"".equals(manager1)) { if (manager1 != null && !"".equals(manager1)) {
flagForHasOtherDepository = false; flagForHasOtherDepository = false;
} } else {
else {
if (flagForOpenDepository != 1) { if (flagForOpenDepository != 1) {
// 如果是开放仓库 // 如果是开放仓库
@ -3277,7 +3275,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
String adminorg = depositoryById.getAdminorg(); String adminorg = depositoryById.getAdminorg();
// List<UserByPort> departmentHeadByUser = userService.getDepartmentHeaderByIdForNoPack(ObjectFormatUtil.toLong(adminorg)); // List<UserByPort> departmentHeadByUser = userService.getDepartmentHeaderByIdForNoPack(ObjectFormatUtil.toLong(adminorg));
List<UserByPort> departmentHeadByUser = PublicConfig.findDepartmentHeadByUser(ObjectFormatUtil.toLong(adminorg),userKey,token); List<UserByPort> departmentHeadByUser = PublicConfig.findDepartmentHeadByUser(ObjectFormatUtil.toLong(adminorg), userKey, token);
for (UserByPort departmentHead : departmentHeadByUser for (UserByPort departmentHead : departmentHeadByUser
) { ) {
@ -3293,7 +3291,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 获取仓储中心负责人 // 获取仓储中心负责人
List<UserByPort> departmentHeadByUser = PublicConfig.findDepartmentHeadByUser(361L,userKey,token); List<UserByPort> departmentHeadByUser = PublicConfig.findDepartmentHeadByUser(361L, userKey, token);
for (UserByPort userByPort : departmentHeadByUser) { for (UserByPort userByPort : departmentHeadByUser) {
depositoryManager.append(userByPort.getId()).append(","); depositoryManager.append(userByPort.getId()).append(",");
@ -3342,7 +3340,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
if ("".equals(depositorymanager)) { if ("".equals(depositorymanager)) {
continue; continue;
} }
UserByPort depositoryManage = PublicConfig.FindUserById(ObjectFormatUtil.toLong(depositorymanager),userKey,token); UserByPort depositoryManage = PublicConfig.FindUserById(ObjectFormatUtil.toLong(depositorymanager), userKey, token);
// 获取用户的用工关系 // 获取用户的用工关系
int emptype = depositoryManage.getEmptype(); int emptype = depositoryManage.getEmptype();
if (emptype > 10) { if (emptype > 10) {
@ -3401,7 +3399,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
if ("".equals(s)) { if ("".equals(s)) {
continue; continue;
} }
UserByPort userByPort = PublicConfig.FindUserById(ObjectFormatUtil.toLong(s),userKey,token); UserByPort userByPort = PublicConfig.FindUserById(ObjectFormatUtil.toLong(s), userKey, token);
// 获取用户的用工关系 // 获取用户的用工关系
int emptype = userByPort.getEmptype(); int emptype = userByPort.getEmptype();
if (emptype > 10) { if (emptype > 10) {
@ -3417,8 +3415,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
s = "PangFuZhen,"; s = "PangFuZhen,";
qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toLong(id), s, userAgent, 1, userKey, token); qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toLong(id), s, userAgent, 1, userKey, token);
}); });
} } else if (map.containsKey("balancePosterPass") && !flagForHasOtherDepository) {
else if (map.containsKey("balancePosterPass") && !flagForHasOtherDepository) {
// 如果是平衡岗人员审批且进入该流程 // 如果是平衡岗人员审批且进入该流程
String result = ""; String result = "";
@ -3438,7 +3435,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 获取综合办负责人 // 获取综合办负责人
List<UserByPort> departmentHeadByUser = PublicConfig.findDepartmentHeadByUser(268L,userKey,token); List<UserByPort> departmentHeadByUser = PublicConfig.findDepartmentHeadByUser(268L, userKey, token);
for (UserByPort userByPort : departmentHeadByUser) { for (UserByPort userByPort : departmentHeadByUser) {
depositoryManager.append(userByPort.getId()).append(","); depositoryManager.append(userByPort.getId()).append(",");
@ -3463,7 +3460,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
if ("".equals(depositorymanager)) { if ("".equals(depositorymanager)) {
continue; continue;
} }
UserByPort depositoryManage = PublicConfig.FindUserById(ObjectFormatUtil.toLong(depositorymanager),userKey,token); UserByPort depositoryManage = PublicConfig.FindUserById(ObjectFormatUtil.toLong(depositorymanager), userKey, token);
// 获取用户的用工关系 // 获取用户的用工关系
int emptype = depositoryManage.getEmptype(); int emptype = depositoryManage.getEmptype();
if (emptype > 10) { if (emptype > 10) {
@ -3522,7 +3519,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
if ("".equals(s)) { if ("".equals(s)) {
continue; continue;
} }
UserByPort userByPort = PublicConfig.FindUserById(ObjectFormatUtil.toLong(s),userKey,token); UserByPort userByPort = PublicConfig.FindUserById(ObjectFormatUtil.toLong(s), userKey, token);
// 获取用户的用工关系 // 获取用户的用工关系
int emptype = userByPort.getEmptype(); int emptype = userByPort.getEmptype();
if (emptype > 10) { if (emptype > 10) {
@ -3538,8 +3535,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
s = "PangFuZhen,"; s = "PangFuZhen,";
qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toLong(id), s, userAgent, 1, userKey, token); qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toLong(id), s, userAgent, 1, userKey, token);
}); });
} } else {
else {
String result = ""; String result = "";
// 开启线程更改其他用户卡片模板样式 // 开启线程更改其他用户卡片模板样式
String simpleTime = DateUtil.getSimpleTime(new Date()); String simpleTime = DateUtil.getSimpleTime(new Date());
@ -3642,7 +3638,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 定义用于获取当前岗位下的人的参数map // 定义用于获取当前岗位下的人的参数map
Map<String, Object> paramForGetUserByPost = new HashMap<>(); Map<String, Object> paramForGetUserByPost = new HashMap<>();
paramForGetUserByPost.put("position", roleAndMaterialType.getUid()); paramForGetUserByPost.put("position", roleAndMaterialType.getUid());
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost,userKey,token); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype(); int emptype = userByPort.getEmptype();
if (emptype > 10) { if (emptype > 10) {
@ -3665,7 +3661,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
for (Long integer : userIdByDid) { for (Long integer : userIdByDid) {
// 获取仓库管理员信息 // 获取仓库管理员信息
UserByPort manager = PublicConfig.FindUserById(integer,userKey,token); UserByPort manager = PublicConfig.FindUserById(integer, userKey, token);
// 获取用户的用工关系 // 获取用户的用工关系
int emptype = manager.getEmptype(); int emptype = manager.getEmptype();
if (emptype > 10) { if (emptype > 10) {
@ -3729,7 +3725,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 定义用于获取当前岗位下的人的参数map // 定义用于获取当前岗位下的人的参数map
Map<String, Object> paramForGetUserByPost = new HashMap<>(); Map<String, Object> paramForGetUserByPost = new HashMap<>();
paramForGetUserByPost.put("position", roleAndDepository.getUserId()); paramForGetUserByPost.put("position", roleAndDepository.getUserId());
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost,userKey,token); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype(); int emptype = userByPort.getEmptype();
if (emptype > 10) { if (emptype > 10) {
@ -3754,7 +3750,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 修改redis中用户的数据 // 修改redis中用户的数据
updateRedisDataForUserManager(integer, minRecordKey); updateRedisDataForUserManager(integer, minRecordKey);
// 获取仓库管理员信息 // 获取仓库管理员信息
UserByPort manager = PublicConfig.FindUserById(integer,userKey,token); UserByPort manager = PublicConfig.FindUserById(integer, userKey, token);
// 获取用户的用工关系 // 获取用户的用工关系
int emptype = manager.getEmptype(); int emptype = manager.getEmptype();
if (emptype > 10) { if (emptype > 10) {
@ -3792,7 +3788,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
if ("".equals(s)) { if ("".equals(s)) {
continue; continue;
} }
UserByPort userByPort = PublicConfig.FindUserById(ObjectFormatUtil.toLong(s),userKey,token); UserByPort userByPort = PublicConfig.FindUserById(ObjectFormatUtil.toLong(s), userKey, token);
// 获取用户的用工关系 // 获取用户的用工关系
int emptype = userByPort.getEmptype(); int emptype = userByPort.getEmptype();
if (emptype > 10) { if (emptype > 10) {
@ -3839,7 +3835,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
SendQyWxMessageThreadPool.execute(() -> { SendQyWxMessageThreadPool.execute(() -> {
// 获取responseCode(key为申请人number) // 获取responseCode(key为申请人number)
//获取部门负责人信息 //获取部门负责人信息
UserByPort departHead = PublicConfig.FindUserById(ObjectFormatUtil.toLong(record.getDepartmenthead()),userKey,token); UserByPort departHead = PublicConfig.FindUserById(ObjectFormatUtil.toLong(record.getDepartmenthead()), userKey, token);
// 获取用户的用工关系 // 获取用户的用工关系
int emptype = departHead.getEmptype(); int emptype = departHead.getEmptype();
if (emptype <= 10) { if (emptype <= 10) {
@ -4793,6 +4789,31 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
userByPortById.setMaindeparmentname(departmentByUser.getName()); userByPortById.setMaindeparmentname(departmentByUser.getName());
userByPortMap.put(applicantId, userByPortById); userByPortMap.put(applicantId, userByPortById);
} }
// 当前物料单价
double mprice = ObjectFormatUtil.divide(applicationInRecord.getMprice(), 100.0, 2);
// 获取入库数据
double quantity = ObjectFormatUtil.divide(applicationInRecord.getQuantity(), 100.0, 2);
// 获取入库单位
String airUnit = applicationInRecord.getAirUnit();
// 获取入库物料单位
String munit = applicationInRecord.getMunit();
double amounts = 0.0;
if (munit.equals(airUnit)) {
// 如果是基础单位
amounts = ObjectFormatUtil.multiply(mprice, quantity);
} else {
// 获取当前对应的拆单记录
Map<String, Object> paramForSplitInfo = new HashMap<>();
paramForSplitInfo.put("mid", applicationInRecord.getMid());
paramForSplitInfo.put("newUnit", airUnit);
SplitInfo splitInfo = splitUnitMapper.findSplitInfoByMidAndUnit(paramForSplitInfo);
// // 获取当前拆单记录与基础单位进制
int splitInfoScaleQuantity = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1L);
BigDecimal bg = new BigDecimal(mprice / splitInfoScaleQuantity * quantity);
amounts = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
}
applicationInRecord.setPrice(amounts);
String time = DateUtil.TimeStampToDateTime(ObjectFormatUtil.toLong(applicationInRecord.getApplicantTime())); String time = DateUtil.TimeStampToDateTime(ObjectFormatUtil.toLong(applicationInRecord.getApplicantTime()));
applicationInRecord.setApplicantName(userByPortById.getName()); applicationInRecord.setApplicantName(userByPortById.getName());
applicationInRecord.setApplicantTime(time); applicationInRecord.setApplicantTime(time);
@ -4941,9 +4962,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 当前单的总额 // 当前单的总额
double amounts = 0.0; double amounts = 0.0;
// 当前物料单价 // 当前物料单价
double mprice = ObjectFormatUtil.divide(recordP.getMprice(),100.0,2); double mprice = ObjectFormatUtil.divide(recordP.getMprice(), 100.0, 2);
// 当前出库数 // 当前出库数
double quantity = ObjectFormatUtil.divide(recordP.getQuantity(),100.0,2); double quantity = ObjectFormatUtil.divide(recordP.getQuantity(), 100.0, 2);
if ("-1".equals(unit) || unit.equals("")) { if ("-1".equals(unit) || unit.equals("")) {
amounts = ObjectFormatUtil.multiply(mprice, quantity); amounts = ObjectFormatUtil.multiply(mprice, quantity);
} else { } else {
@ -4965,8 +4986,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
UserByPort userByPortById = null; UserByPort userByPortById = null;
if (userByPortMap.containsKey(applicantId)) { if (userByPortMap.containsKey(applicantId)) {
userByPortById = userByPortMap.get(applicantId); userByPortById = userByPortMap.get(applicantId);
} } else {
else {
userByPortById = userService.findUserByIdForNoPack(applicantId); userByPortById = userService.findUserByIdForNoPack(applicantId);
Administration departmentByUser = administrativeService.getDepartmentByUser(userByPortById); Administration departmentByUser = administrativeService.getDepartmentByUser(userByPortById);
userByPortById.setMaindeparmentname(departmentByUser.getName()); userByPortById.setMaindeparmentname(departmentByUser.getName());
@ -5097,11 +5117,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 当前单的总额 // 当前单的总额
double amounts = 0.0; double amounts = 0.0;
// 当前物料单价 // 当前物料单价
double mprice = ObjectFormatUtil.divide(recordP.getMprice(),100.0,2); double mprice = ObjectFormatUtil.divide(recordP.getMprice(), 100.0, 2);
// 当前出库数 // 当前出库数
double quantity = ObjectFormatUtil.divide(recordP.getQuantity(),100.0,2); double quantity = ObjectFormatUtil.divide(recordP.getQuantity(), 100.0, 2);
if ("-1".equals(unit) || unit.equals("")) { if ("-1".equals(unit) || unit.equals("")) {
amounts = ObjectFormatUtil.multiply(mprice, quantity); amounts = ObjectFormatUtil.multiply(mprice, quantity);
} else { } else {
// // 获取当前对应的拆单记录 // // 获取当前对应的拆单记录
Map<String, Object> paramForSplitInfo = new HashMap<>(); Map<String, Object> paramForSplitInfo = new HashMap<>();
@ -5121,8 +5141,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
UserByPort userByPortById = null; UserByPort userByPortById = null;
if (userByPortMap.containsKey(applicantId)) { if (userByPortMap.containsKey(applicantId)) {
userByPortById = userByPortMap.get(applicantId); userByPortById = userByPortMap.get(applicantId);
} } else {
else {
userByPortById = userService.findUserByIdForNoPack(applicantId); userByPortById = userService.findUserByIdForNoPack(applicantId);
Administration departmentByUser = administrativeService.getDepartmentByUser(userByPortById); Administration departmentByUser = administrativeService.getDepartmentByUser(userByPortById);
userByPortById.setMaindeparmentname(departmentByUser.getName()); userByPortById.setMaindeparmentname(departmentByUser.getName());

35
src/main/resources/templates/pages/depository/table-in.html

@ -97,7 +97,7 @@
<script type="text/html" id="toolbarDemo"> <script type="text/html" id="toolbarDemo">
<div class="layui-btn-container"> <div class="layui-btn-container">
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 新建</button> <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 新建</button>
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete" <button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete" id="delete"
th:style="'display:'+${display}"> 删除 th:style="'display:'+${display}"> 删除
</button> </button>
</div> </div>
@ -152,6 +152,24 @@
}; };
let cols = [
{type: "checkbox", width: 50},
{field: "aircode", title: '申请编码', width: 250,},
{field: 'mname', width: 150, title: '物料名称'},
{field: 'mversion', width: 150, title: '规格型号'},
{field: 'airUnit', width: 100, title: '计量单位'},
{field: 'mcode', width: 150, title: '存货编码'},
{field: 'quantity', width: 100, title: '数量', sort: true},
{field: 'depositoryName', width: 150, title: '仓库名称'},
{field: 'applicantName', width: 200, title: '提交人'},
{field: 'adminorgName', width: 150, title: '提交人部门'},
{field: 'applicantTime', width: 200, title: '提交时间', sort: true},
{field: 'applyRemark', width: 200, title: '备注'},
{field: 'airstate', width: 200, title: '状态'},
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
];
let flagForReload = true;
//日期 //日期
laydate.render({ laydate.render({
elem: '#startDate', elem: '#startDate',
@ -201,7 +219,7 @@
{field: 'mversion', width: 150, title: '规格型号'}, {field: 'mversion', width: 150, title: '规格型号'},
{field: 'airUnit', width: 100, title: '计量单位'}, {field: 'airUnit', width: 100, title: '计量单位'},
{field: 'mcode', width: 150, title: '存货编码'}, {field: 'mcode', width: 150, title: '存货编码'},
{field: 'quantity', width: 150, title: '数量', sort: true}, {field: 'quantity', width: 100, title: '数量', sort: true},
{field: 'depositoryName', width: 150, title: '仓库名称'}, {field: 'depositoryName', width: 150, title: '仓库名称'},
{field: 'applicantName', width: 200, title: '提交人'}, {field: 'applicantName', width: 200, title: '提交人'},
{field: 'adminorgName', width: 150, title: '提交人部门'}, {field: 'adminorgName', width: 150, title: '提交人部门'},
@ -215,7 +233,18 @@
limit: 15, limit: 15,
page: true, page: true,
skin: 'line', skin: 'line',
done: function () { done: function (res, curr, count) {
let display = $("#delete").css("display");
if (display !== "none") {
if (flagForReload) {
flagForReload = false;
let col1 = {field: 'price', title: '金额', width: 100, sort: true};
let col2 = {field: 'mprice', title: '单价', width: 100, sort: true};
cols.splice(7, 0, col2);
cols.splice(8, 0, col1);
table.reload('currentTableId', {cols: [cols]});
}
}
} }
}); });

Loading…
Cancel
Save