|
|
|
@ -8,28 +8,23 @@ import java.util.stream.Collectors;
|
|
|
|
|
import com.os.common.constant.MesConstants;
|
|
|
|
|
import com.os.common.exception.ServiceException;
|
|
|
|
|
import com.os.common.utils.DateUtils;
|
|
|
|
|
import com.os.common.utils.SecurityUtils;
|
|
|
|
|
import com.os.common.utils.StringUtils;
|
|
|
|
|
import com.os.common.utils.uuid.PlanCodeUtils;
|
|
|
|
|
import com.os.mes.api.domain.ERPParamDto;
|
|
|
|
|
import com.os.mes.api.domain.LatestSalary;
|
|
|
|
|
import com.os.mes.api.service.IERPPortService;
|
|
|
|
|
import com.os.mes.base.domain.BaseProcessInfo;
|
|
|
|
|
import com.os.mes.base.domain.BaseStaffInfo;
|
|
|
|
|
import com.os.mes.base.domain.BaseTeamMembers;
|
|
|
|
|
import com.os.mes.base.mapper.BaseProcessInfoMapper;
|
|
|
|
|
import com.os.mes.base.mapper.BaseStaffInfoMapper;
|
|
|
|
|
import com.os.mes.base.mapper.BaseTeamMembersMapper;
|
|
|
|
|
import com.os.mes.prod.domain.ProdOrderInfo;
|
|
|
|
|
import com.os.mes.prod.domain.ProdPlanDetail;
|
|
|
|
|
import com.os.mes.prod.domain.ProdPlanExecuteUser;
|
|
|
|
|
import com.os.mes.prod.domain.ProdPlanInfo;
|
|
|
|
|
import com.os.mes.prod.mapper.ProdOrderInfoMapper;
|
|
|
|
|
import com.os.mes.prod.mapper.ProdPlanExecuteUserMapper;
|
|
|
|
|
import com.os.mes.prod.mapper.ProdPlanInfoMapper;
|
|
|
|
|
import com.os.mes.record.domain.RecordStaffCommute;
|
|
|
|
|
import com.os.mes.record.domain.StaffSalaryVo;
|
|
|
|
|
import com.os.mes.record.mapper.RecordStaffCommuteMapper;
|
|
|
|
|
import com.sun.org.apache.xpath.internal.operations.Bool;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import com.os.mes.record.mapper.RecordStaffSalaryMapper;
|
|
|
|
@ -88,7 +83,23 @@ public class RecordStaffSalaryServiceImpl implements IRecordStaffSalaryService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<RecordStaffSalary> selectRecordStaffSalaryList(RecordStaffSalary recordStaffSalary) {
|
|
|
|
|
return recordStaffSalaryMapper.selectRecordStaffSalaryList(recordStaffSalary);
|
|
|
|
|
List<RecordStaffSalary> recordStaffSalaryList = recordStaffSalaryMapper.selectRecordStaffSalaryList(recordStaffSalary);
|
|
|
|
|
List<BaseTeamMembers> teamMembers = baseTeamMembersMapper.selectBaseTeamMembersList(new BaseTeamMembers());
|
|
|
|
|
for (RecordStaffSalary staffSalary : recordStaffSalaryList) {
|
|
|
|
|
if (StringUtils.isEmpty(staffSalary.getGroupId())) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
for (BaseTeamMembers teamMember : teamMembers) {
|
|
|
|
|
if (staffSalary.getGroupId().contains(teamMember.getTeamCode())) {
|
|
|
|
|
if (StringUtils.isEmpty(staffSalary.getTeamName())) {
|
|
|
|
|
staffSalary.setTeamName(teamMember.getTeamName());
|
|
|
|
|
} else {
|
|
|
|
|
staffSalary.setTeamName(staffSalary.getTeamName() + "," + teamMember.getTeamName());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return recordStaffSalaryList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -149,130 +160,151 @@ public class RecordStaffSalaryServiceImpl implements IRecordStaffSalaryService {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = ServiceException.class)
|
|
|
|
|
public List<RecordStaffSalary> selectTeamEmployeesWages(RecordStaffSalary recordStaffSalary) {
|
|
|
|
|
List<RecordStaffSalary> result = new ArrayList<>();
|
|
|
|
|
//调用最新工资系数接口
|
|
|
|
|
LatestSalary salaryData = portService.getERPLatestSalaryData(new ERPParamDto());
|
|
|
|
|
|
|
|
|
|
List<BaseTeamMembers> teamMembers = baseTeamMembersMapper.selectBaseTeamMembersList(new BaseTeamMembers());
|
|
|
|
|
// List<BaseTeamMembers> teamMembers = baseTeamMembersMapper.selectBaseTeamMembersList(new BaseTeamMembers());
|
|
|
|
|
|
|
|
|
|
Map<String, Object> params = recordStaffSalary.getParams();
|
|
|
|
|
ProdPlanExecuteUser selectExecuteUser = new ProdPlanExecuteUser();
|
|
|
|
|
selectExecuteUser.setParams(params); //beginOrderDate、endOrderDate
|
|
|
|
|
selectExecuteUser.setParams(params); //beginOffWorkTime、beginOffWorkTime 下班后才可以计算之前的工资
|
|
|
|
|
selectExecuteUser.setIsFlag(MesConstants.MES_IS_SALARY_NO);//未生成工资
|
|
|
|
|
List<ProdPlanExecuteUser> planUserList = prodPlanExecuteUserMapper.selectProdPlanExecuteUserList(selectExecuteUser);
|
|
|
|
|
|
|
|
|
|
Date beginOrderDate = null;
|
|
|
|
|
Date endOrderDate = null;
|
|
|
|
|
if (params.containsKey("beginOrderDate")) {
|
|
|
|
|
beginOrderDate = DateUtils.parseDate(String.valueOf(params.get("beginOrderDate")));
|
|
|
|
|
if (params.containsKey("beginOffWorkTime")) {
|
|
|
|
|
beginOrderDate = DateUtils.parseDate(String.valueOf(params.get("beginOffWorkTime")));
|
|
|
|
|
}
|
|
|
|
|
if (params.containsKey("endOrderDate")) {
|
|
|
|
|
endOrderDate = DateUtils.parseDate(String.valueOf(params.get("endOrderDate")));
|
|
|
|
|
if (params.containsKey("endOffWorkTime")) {
|
|
|
|
|
endOrderDate = DateUtils.parseDate(String.valueOf(params.get("endOffWorkTime")));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
long objId = 1L;
|
|
|
|
|
String taskCode = PlanCodeUtils.getTaskCode();
|
|
|
|
|
Map<String, List<ProdPlanExecuteUser>> orderCodeMap = planUserList.stream().collect(Collectors.groupingBy(ProdPlanExecuteUser::getOrderCode));
|
|
|
|
|
for (String orderCode : orderCodeMap.keySet()) {
|
|
|
|
|
List<ProdPlanExecuteUser> orderCodeUserList = orderCodeMap.get(orderCode);
|
|
|
|
|
for (ProdPlanExecuteUser prodPlanExecuteUser : orderCodeUserList) {
|
|
|
|
|
//工序工资系数
|
|
|
|
|
BigDecimal coefficient = new BigDecimal(0);
|
|
|
|
|
//工序生产面积
|
|
|
|
|
BigDecimal totalArea = new BigDecimal(0);
|
|
|
|
|
///参加该工序的所有人的工资系数的总和
|
|
|
|
|
BigDecimal wageCoefficientSum = new BigDecimal(0);
|
|
|
|
|
///该工序的输送带面积
|
|
|
|
|
BigDecimal beltTotalArea = new BigDecimal(0);
|
|
|
|
|
//当前工序编号
|
|
|
|
|
String currentProcessCode = null;
|
|
|
|
|
//硫化工序 工序硫化的工资 = 硫化系数*硫化面积*(工资系数/参加该工序的所有人的工资系数的总和)
|
|
|
|
|
//硫化面积=硫化米数/客户要求总米数*硫化面积
|
|
|
|
|
if (prodPlanExecuteUser.getProcessCode().equals(MesConstants.MES_PROCESS_VULCANIZATION)) {
|
|
|
|
|
coefficient = salaryData.getVulcanizationCoefficient();
|
|
|
|
|
beltTotalArea = prodPlanExecuteUser.getSulfurizationArea();
|
|
|
|
|
}
|
|
|
|
|
//出布工序
|
|
|
|
|
if (prodPlanExecuteUser.getProcessCode().equals(MesConstants.MES_PROCESS_OUT_CLOTH)) {
|
|
|
|
|
coefficient = salaryData.getDistributionCoefficient();
|
|
|
|
|
beltTotalArea = prodPlanExecuteUser.getRolledFabricArea();
|
|
|
|
|
}
|
|
|
|
|
//成型工序
|
|
|
|
|
if (prodPlanExecuteUser.getProcessCode().equals(MesConstants.MES_PROCESS_FORMING)) {
|
|
|
|
|
beltTotalArea = prodPlanExecuteUser.getFormingArea();
|
|
|
|
|
}
|
|
|
|
|
//包胶工序
|
|
|
|
|
if (prodPlanExecuteUser.getProcessCode().equals(MesConstants.MES_PROCESS_LAGGING)) {
|
|
|
|
|
coefficient = salaryData.getEncapsulationCoefficient();
|
|
|
|
|
beltTotalArea = prodPlanExecuteUser.getRollCoatingArea();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
totalArea = prodPlanExecuteUser.getCompleteAmount()
|
|
|
|
|
.divide(prodPlanExecuteUser.getBeltRequiredLength(), 12, RoundingMode.HALF_UP)
|
|
|
|
|
.multiply(beltTotalArea);
|
|
|
|
|
Map<String, List<ProdPlanExecuteUser>> offWorkTimeUserMap = planUserList.stream().collect(Collectors.groupingBy(ProdPlanExecuteUser::getOffWorkTime));
|
|
|
|
|
|
|
|
|
|
wageCoefficientSum = orderCodeUserList.stream().filter(e -> e.getPlanCode().equals(prodPlanExecuteUser.getPlanCode())
|
|
|
|
|
&& e.getBatchNumber().equals(prodPlanExecuteUser.getBatchNumber()))
|
|
|
|
|
.map(ProdPlanExecuteUser::getWageCoefficient).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
|
|
|
|
|
BigDecimal revenueAmount = new BigDecimal(0);//员工收入
|
|
|
|
|
if (wageCoefficientSum.compareTo(BigDecimal.ZERO) > 0){
|
|
|
|
|
BigDecimal staffCoefficient = prodPlanExecuteUser.getWageCoefficient().divide(wageCoefficientSum, 12, RoundingMode.HALF_UP);
|
|
|
|
|
revenueAmount = coefficient.multiply(totalArea).multiply(staffCoefficient).setScale(2, RoundingMode.HALF_UP);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(prodPlanExecuteUser.getTeamCode())) {
|
|
|
|
|
for (BaseTeamMembers teamMember : teamMembers) {
|
|
|
|
|
if (prodPlanExecuteUser.getTeamCode().contains(teamMember.getTeamCode())) {
|
|
|
|
|
if (StringUtils.isEmpty(prodPlanExecuteUser.getTeamName())) {
|
|
|
|
|
prodPlanExecuteUser.setTeamName(teamMember.getTeamName());
|
|
|
|
|
} else {
|
|
|
|
|
prodPlanExecuteUser.setTeamName(prodPlanExecuteUser.getTeamName() + "," + teamMember.getTeamName());
|
|
|
|
|
}
|
|
|
|
|
for (String offWorkTime : offWorkTimeUserMap.keySet()) {
|
|
|
|
|
List<ProdPlanExecuteUser> executeUserTimeList = offWorkTimeUserMap.get(offWorkTime);
|
|
|
|
|
Map<String, List<ProdPlanExecuteUser>> orderCodeMap = executeUserTimeList.stream().collect(Collectors.groupingBy(ProdPlanExecuteUser::getOrderCode));
|
|
|
|
|
for (String orderCode : orderCodeMap.keySet()) {
|
|
|
|
|
List<ProdPlanExecuteUser> orderCodeUserList = orderCodeMap.get(orderCode);
|
|
|
|
|
for (ProdPlanExecuteUser prodPlanExecuteUser : orderCodeUserList) {
|
|
|
|
|
//获取员工收入金额
|
|
|
|
|
BigDecimal revenueAmount = this.getStaffreVenueAmount(orderCodeUserList, prodPlanExecuteUser, salaryData);
|
|
|
|
|
String teamCode = prodPlanExecuteUser.getTeamCode();
|
|
|
|
|
String teamName = prodPlanExecuteUser.getTeamName();
|
|
|
|
|
String idCard = prodPlanExecuteUser.getIdCard();
|
|
|
|
|
BigDecimal completeAmount = prodPlanExecuteUser.getCompleteAmount();
|
|
|
|
|
String revenueReason = prodPlanExecuteUser.getStationName().substring(0, 2) + " "
|
|
|
|
|
+ prodPlanExecuteUser.getBeltLengthSpecifications() + " " + prodPlanExecuteUser.getOrderCode();
|
|
|
|
|
RecordStaffSalary staffSalary = new RecordStaffSalary();
|
|
|
|
|
for (RecordStaffSalary staff : result) {
|
|
|
|
|
if (staff.getIdCard().equals(idCard) && staff.getGroupId().equals(prodPlanExecuteUser.getTeamCode())
|
|
|
|
|
&& staff.getRevenueReason().equals(revenueReason) && offWorkTime.equals(DateUtils.dateTime(staff.getEventDate()))) {
|
|
|
|
|
staffSalary = staff;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String teamCode = prodPlanExecuteUser.getTeamCode();
|
|
|
|
|
String teamName = prodPlanExecuteUser.getTeamName();
|
|
|
|
|
String idCard = prodPlanExecuteUser.getIdCard();
|
|
|
|
|
String revenueReason = prodPlanExecuteUser.getStationName().substring(0, 2) + " "
|
|
|
|
|
+ prodPlanExecuteUser.getBeltLengthSpecifications() + " " + prodPlanExecuteUser.getOrderCode();
|
|
|
|
|
|
|
|
|
|
RecordStaffSalary staffSalary = new RecordStaffSalary();
|
|
|
|
|
for (RecordStaffSalary staff : result) {
|
|
|
|
|
if (staff.getIdCard().equals(idCard) && staff.getGroupId().equals(prodPlanExecuteUser.getTeamCode())
|
|
|
|
|
&& staff.getRevenueReason().equals(revenueReason)) {
|
|
|
|
|
staffSalary = staff;
|
|
|
|
|
if (StringUtils.isEmpty(staffSalary.getCardId())) {
|
|
|
|
|
staffSalary.setTaskCode(taskCode);
|
|
|
|
|
staffSalary.setIdCard(prodPlanExecuteUser.getIdCard());
|
|
|
|
|
staffSalary.setGroupId(teamCode);
|
|
|
|
|
staffSalary.setEventDate(DateUtils.parseDate(offWorkTime));
|
|
|
|
|
staffSalary.setSalaryCategory("收入");
|
|
|
|
|
staffSalary.setRevenueClass("完成生产任务");
|
|
|
|
|
revenueAmount = revenueAmount.setScale(2, RoundingMode.HALF_UP);
|
|
|
|
|
staffSalary.setRevenueAmount(revenueAmount);
|
|
|
|
|
staffSalary.setSalaryCoefficient(prodPlanExecuteUser.getWageCoefficient());
|
|
|
|
|
staffSalary.setStaffName(prodPlanExecuteUser.getStaffName());
|
|
|
|
|
staffSalary.setCardId(idCard);
|
|
|
|
|
staffSalary.setTeamName(teamName);
|
|
|
|
|
staffSalary.setBeginDate(beginOrderDate);
|
|
|
|
|
staffSalary.setEndDate(endOrderDate);
|
|
|
|
|
staffSalary.setRevenueReason(revenueReason);
|
|
|
|
|
staffSalary.setOrderCode(prodPlanExecuteUser.getOrderCode());
|
|
|
|
|
staffSalary.setPlanCode(prodPlanExecuteUser.getPlanCode());
|
|
|
|
|
staffSalary.setIsErp(MesConstants.MES_IS_ERP_NO);
|
|
|
|
|
staffSalary.setProdNumber(completeAmount);
|
|
|
|
|
result.add(staffSalary);
|
|
|
|
|
} else {
|
|
|
|
|
staffSalary.setRevenueAmount(staffSalary.getRevenueAmount().add(revenueAmount));
|
|
|
|
|
staffSalary.setProdNumber(staffSalary.getProdNumber().add(completeAmount));
|
|
|
|
|
staffSalary.setGroupId(teamCode);
|
|
|
|
|
staffSalary.setTeamName(teamName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isEmpty(staffSalary.getCardId())) {
|
|
|
|
|
staffSalary.setObjId(objId++);
|
|
|
|
|
staffSalary.setTaskCode(taskCode);
|
|
|
|
|
staffSalary.setIdCard(prodPlanExecuteUser.getIdCard());
|
|
|
|
|
staffSalary.setGroupId(teamCode);
|
|
|
|
|
staffSalary.setEventDate(new Date());
|
|
|
|
|
staffSalary.setSalaryCategory("收入");
|
|
|
|
|
staffSalary.setRevenueClass("完成生产任务");
|
|
|
|
|
revenueAmount = revenueAmount.setScale(2, RoundingMode.HALF_UP);
|
|
|
|
|
staffSalary.setRevenueAmount(revenueAmount);
|
|
|
|
|
staffSalary.setSalaryCoefficient(prodPlanExecuteUser.getWageCoefficient());
|
|
|
|
|
staffSalary.setStaffName(prodPlanExecuteUser.getStaffName());
|
|
|
|
|
staffSalary.setCardId(idCard);
|
|
|
|
|
staffSalary.setTeamName(teamName);
|
|
|
|
|
staffSalary.setBeginDate(beginOrderDate);
|
|
|
|
|
staffSalary.setEndDate(endOrderDate);
|
|
|
|
|
staffSalary.setRevenueReason(revenueReason);
|
|
|
|
|
staffSalary.setOrderCode(prodPlanExecuteUser.getOrderCode());
|
|
|
|
|
result.add(staffSalary);
|
|
|
|
|
} else {
|
|
|
|
|
staffSalary.setRevenueAmount(staffSalary.getRevenueAmount().add(revenueAmount));
|
|
|
|
|
staffSalary.setGroupId(teamCode);
|
|
|
|
|
staffSalary.setTeamName(teamName);
|
|
|
|
|
ProdPlanExecuteUser updateExecuteUser = new ProdPlanExecuteUser();
|
|
|
|
|
updateExecuteUser.setObjId(prodPlanExecuteUser.getObjId());
|
|
|
|
|
updateExecuteUser.setIsFlag(MesConstants.MES_IS_SALARY_YES);
|
|
|
|
|
updateExecuteUser.setUpdatedBy(SecurityUtils.getUsername());
|
|
|
|
|
updateExecuteUser.setUpdatedTime(DateUtils.getNowDate());
|
|
|
|
|
prodPlanExecuteUserMapper.updateProdPlanExecuteUser(updateExecuteUser);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
for (RecordStaffSalary salary : result) {
|
|
|
|
|
this.insertRecordStaffSalary(salary);
|
|
|
|
|
}
|
|
|
|
|
recordStaffSalary.setIsErp(MesConstants.MES_IS_ERP_NO);
|
|
|
|
|
return this.selectRecordStaffSalaryList(recordStaffSalary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取订单的员工工资
|
|
|
|
|
* @param orderCodeUserList
|
|
|
|
|
* @param prodPlanExecuteUser
|
|
|
|
|
* @param salaryData
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private BigDecimal getStaffreVenueAmount(List<ProdPlanExecuteUser> orderCodeUserList, ProdPlanExecuteUser prodPlanExecuteUser, LatestSalary salaryData) {
|
|
|
|
|
//工序工资系数
|
|
|
|
|
BigDecimal coefficient = new BigDecimal(0);
|
|
|
|
|
//工序生产面积
|
|
|
|
|
BigDecimal totalArea = new BigDecimal(0);
|
|
|
|
|
///参加该工序的所有人的工资系数的总和
|
|
|
|
|
BigDecimal wageCoefficientSum = new BigDecimal(0);
|
|
|
|
|
///该工序的输送带面积
|
|
|
|
|
BigDecimal beltTotalArea = new BigDecimal(0);
|
|
|
|
|
//当前工序编号
|
|
|
|
|
String currentProcessCode = null;
|
|
|
|
|
//硫化工序 工序硫化的工资 = 硫化系数*硫化面积*(工资系数/参加该工序的所有人的工资系数的总和)
|
|
|
|
|
//硫化面积=硫化米数/客户要求总米数*硫化面积
|
|
|
|
|
if (prodPlanExecuteUser.getProcessCode().equals(MesConstants.MES_PROCESS_VULCANIZATION)) {
|
|
|
|
|
coefficient = salaryData.getVulcanizationCoefficient();
|
|
|
|
|
beltTotalArea = prodPlanExecuteUser.getSulfurizationArea();
|
|
|
|
|
}
|
|
|
|
|
//出布工序
|
|
|
|
|
if (prodPlanExecuteUser.getProcessCode().equals(MesConstants.MES_PROCESS_OUT_CLOTH)) {
|
|
|
|
|
coefficient = salaryData.getDistributionCoefficient();
|
|
|
|
|
beltTotalArea = prodPlanExecuteUser.getRolledFabricArea();
|
|
|
|
|
}
|
|
|
|
|
//成型工序
|
|
|
|
|
if (prodPlanExecuteUser.getProcessCode().equals(MesConstants.MES_PROCESS_FORMING)) {
|
|
|
|
|
beltTotalArea = prodPlanExecuteUser.getFormingArea();
|
|
|
|
|
}
|
|
|
|
|
//包胶工序
|
|
|
|
|
if (prodPlanExecuteUser.getProcessCode().equals(MesConstants.MES_PROCESS_LAGGING)) {
|
|
|
|
|
coefficient = salaryData.getEncapsulationCoefficient();
|
|
|
|
|
beltTotalArea = prodPlanExecuteUser.getRollCoatingArea();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
totalArea = prodPlanExecuteUser.getCompleteAmount()
|
|
|
|
|
.divide(prodPlanExecuteUser.getBeltRequiredLength(), 12, RoundingMode.HALF_UP)
|
|
|
|
|
.multiply(beltTotalArea);
|
|
|
|
|
|
|
|
|
|
wageCoefficientSum = orderCodeUserList.stream().filter(e -> e.getPlanCode().equals(prodPlanExecuteUser.getPlanCode())
|
|
|
|
|
&& e.getBatchNumber().equals(prodPlanExecuteUser.getBatchNumber()))
|
|
|
|
|
.map(ProdPlanExecuteUser::getWageCoefficient).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
|
|
|
|
|
BigDecimal revenueAmount = new BigDecimal(0);//员工收入
|
|
|
|
|
if (wageCoefficientSum.compareTo(BigDecimal.ZERO) > 0){
|
|
|
|
|
BigDecimal staffCoefficient = prodPlanExecuteUser.getWageCoefficient().divide(wageCoefficientSum, 12, RoundingMode.HALF_UP);
|
|
|
|
|
revenueAmount = coefficient.multiply(totalArea).multiply(staffCoefficient).setScale(2, RoundingMode.HALF_UP);
|
|
|
|
|
}
|
|
|
|
|
return revenueAmount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -455,14 +487,13 @@ public class RecordStaffSalaryServiceImpl implements IRecordStaffSalaryService {
|
|
|
|
|
Thread thread = new Thread(() -> {
|
|
|
|
|
for (RecordStaffSalary staffSalary : recordStaffSalaryList) {
|
|
|
|
|
String objectId = portService.addSalaryBreakdown(staffSalary);
|
|
|
|
|
staffSalary.setObjectId(objectId);
|
|
|
|
|
staffSalary.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
recordStaffSalaryMapper.insertRecordStaffSalary(staffSalary);
|
|
|
|
|
//更新ERP上传标识
|
|
|
|
|
ProdOrderInfo orderInfo = new ProdOrderInfo();
|
|
|
|
|
orderInfo.setOrderCode(staffSalary.getOrderCode());
|
|
|
|
|
orderInfo.setIsFlag("1");
|
|
|
|
|
prodOrderInfoMapper.updateProdOrderInfo(orderInfo);
|
|
|
|
|
RecordStaffSalary updateSalary = new RecordStaffSalary();
|
|
|
|
|
updateSalary.setObjId(staffSalary.getObjId());
|
|
|
|
|
updateSalary.setObjectId(objectId);
|
|
|
|
|
updateSalary.setIsErp(MesConstants.MES_IS_ERP_YES);
|
|
|
|
|
updateSalary.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
recordStaffSalaryMapper.updateRecordStaffSalary(updateSalary);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
thread.start(); //启动新线程
|
|
|
|
|