Compare commits

...

10 Commits

@ -6,9 +6,9 @@ spring:
# 主库数据源
master:
driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://121.37.164.0:1433;SelectMethod=cursor;DatabaseName=xmxs_os
url: jdbc:sqlserver://119.45.202.115:1433;SelectMethod=cursor;DatabaseName=xmxs_os
username: sa
password: Yq123456
password: haiwei@123
# 从库数据源
slave:
driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver

@ -0,0 +1,57 @@
package com.os.common.constant;
/**
* MES
*
* @author ruoyi
*/
public class MesConstants
{
/**
* -
*/
public static final String MES_PROCESS_OUT_CLOTH = "1010";
/**
* -
*/
public static final String MES_PROCESS_FORMING = "1011";
/**
* -
*/
public static final String MES_PROCESS_LAGGING = "1012";
/**
* -
*/
public static final String MES_PROCESS_VULCANIZATION = "1020";
/**
* -270
*/
public static final String MES_PROCESS_270_FILM = "1030";
/**
* ERP0 1
*/
public static final String MES_IS_ERP_NO = "0";
/**
* ERP0 1
*/
public static final String MES_IS_ERP_YES = "1";
/**
* 0 1
*/
public static final String MES_IS_SALARY_NO = "0";
/**
* 0 1
*/
public static final String MES_IS_SALARY_YES = "1";
}

@ -37,7 +37,7 @@ public class EmsBaseEnergyTypeController extends BaseController
/**
*
*/
@PreAuthorize("@ss.hasPermi('ems.base:baseEnergyType:list')")
@PreAuthorize("@ss.hasPermi('ems/base:baseEnergyType:list')")
@GetMapping("/list")
public TableDataInfo list(EmsBaseEnergyType emsBaseEnergyType)
{
@ -59,7 +59,7 @@ public class EmsBaseEnergyTypeController extends BaseController
/**
*
*/
@PreAuthorize("@ss.hasPermi('ems.base:baseEnergyType:export')")
@PreAuthorize("@ss.hasPermi('ems/base:baseEnergyType:export')")
@Log(title = "能源类型信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EmsBaseEnergyType emsBaseEnergyType)
@ -72,7 +72,7 @@ public class EmsBaseEnergyTypeController extends BaseController
/**
*
*/
@PreAuthorize("@ss.hasPermi('ems.base:baseEnergyType:query')")
@PreAuthorize("@ss.hasPermi('ems/base:baseEnergyType:query')")
@GetMapping(value = "/{objId}")
public AjaxResult getInfo(@PathVariable("objId") Long objId)
{
@ -82,7 +82,7 @@ public class EmsBaseEnergyTypeController extends BaseController
/**
*
*/
@PreAuthorize("@ss.hasPermi('ems.base:baseEnergyType:add')")
@PreAuthorize("@ss.hasPermi('ems/base:baseEnergyType:add')")
@Log(title = "能源类型信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EmsBaseEnergyType emsBaseEnergyType)
@ -93,7 +93,7 @@ public class EmsBaseEnergyTypeController extends BaseController
/**
*
*/
@PreAuthorize("@ss.hasPermi('ems.base:baseEnergyType:edit')")
@PreAuthorize("@ss.hasPermi('ems/base:baseEnergyType:edit')")
@Log(title = "能源类型信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EmsBaseEnergyType emsBaseEnergyType)
@ -104,7 +104,7 @@ public class EmsBaseEnergyTypeController extends BaseController
/**
*
*/
@PreAuthorize("@ss.hasPermi('ems.base:baseEnergyType:remove')")
@PreAuthorize("@ss.hasPermi('ems/base:baseEnergyType:remove')")
@Log(title = "能源类型信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}")
public AjaxResult remove(@PathVariable Long[] objIds)

@ -71,6 +71,10 @@ public class EmsRecordDnbInstant extends BaseEntity
@Excel(name = "正向有功")
private BigDecimal zxyg;
/** 反向有功 */
@Excel(name = "反向有功")
private BigDecimal fxyg;
/** 有功功率 */
@Excel(name = "有功功率")
private BigDecimal activePower;
@ -83,6 +87,14 @@ public class EmsRecordDnbInstant extends BaseEntity
@Excel(name = "采集方式", readConverterExp = "0=自动,1=手动")
private Long collectType;
public BigDecimal getFxyg() {
return fxyg;
}
public void setFxyg(BigDecimal fxyg) {
this.fxyg = fxyg;
}
public String getMonitorName() {
return monitorName;
}

@ -74,6 +74,34 @@ public class EmsReportPointDnb extends BaseEntity {
@Excel(name = "修改标识", readConverterExp = "0=是,1=否")
private String updateFlag;
/**
*
*/
@Excel(name = "发电量")
private BigDecimal powerExpend;
/**
*
*/
@Excel(name = "反向有功仪表值")
private BigDecimal powerValue;
public BigDecimal getPowerExpend() {
return powerExpend;
}
public void setPowerExpend(BigDecimal powerExpend) {
this.powerExpend = powerExpend;
}
public BigDecimal getPowerValue() {
return powerValue;
}
public void setPowerValue(BigDecimal powerValue) {
this.powerValue = powerValue;
}
public String getMonitorName() {
return monitorName;
}

@ -34,6 +34,12 @@ public class EnergyStatisticalReport extends BaseEntity {
@Excel(name = "耗量(kwh)")
private BigDecimal expend;
/**
* (kwh)
*/
@Excel(name = "发电量(kwh)")
private BigDecimal powerExpend;
/**
*
*/
@ -52,6 +58,14 @@ public class EnergyStatisticalReport extends BaseEntity {
@Excel(name = "仪表值(kwh)")
private BigDecimal instrumentValue;
public BigDecimal getPowerExpend() {
return powerExpend;
}
public void setPowerExpend(BigDecimal powerExpend) {
this.powerExpend = powerExpend;
}
public String getWorkUnitCode() {
return workUnitCode;
}

@ -93,15 +93,22 @@ public class EmsReportServiceImpl implements IEmsReportService {
for (EmsBaseWorkUnit unit : workUnits) {
HashMap<String, Object> typeResultMap = new HashMap<>();
typeResultMap.put("objId", unit.getObjId());
typeResultMap.put("parentId", unit.getParentId());
typeResultMap.put("unitName", unit.getWorkUnitName());
selectMap.put("workUnitCode", unit.getWorkUnitCode());
List<EnergyStatisticalReport> reportList = this.energyStatisticalReportList(selectMap);
BigDecimal expendSum = new BigDecimal(0);
BigDecimal powerExpendSum = new BigDecimal(0);
for (EnergyStatisticalReport report : reportList) {
typeResultMap.put("dateData|" + report.getBeginTime(), report.getExpend().add(report.getPowerExpend()));
typeResultMap.put("expend" + report.getBeginTime(), report.getExpend());
expendSum = expendSum.add(report.getExpend());
typeResultMap.put("powerExpend" + report.getBeginTime(), report.getPowerExpend());
powerExpendSum = powerExpendSum.add(report.getPowerExpend());
}
typeResultMap.put("expendSum", expendSum.toPlainString());
typeResultMap.put("powerExpendSum", powerExpendSum.toPlainString());
resultList.add(typeResultMap);
}

@ -37,6 +37,7 @@
rdi.record_time,
rdi.glys,
rdi.zxyg,
rdi.fxyg,
rdi.active_power,
rdi.reactive_power,
rdi.collect_type

@ -12,6 +12,7 @@
WU.WORK_UNIT_NAME workUnitName,
MAX(RPD.INSTRUMENT_VALUE) instrumentValue,
SUM(RPD.EXPEND) expend,
SUM(RPD.power_expend) powerExpend,
SUBSTRING(FORMAT(RPD.BEGIN_TIME, 'yyyy-MM-dd HH:mm:ss'), 1, DT.TIMESUB) beginTime,
SUBSTRING(FORMAT(RPD.BEGIN_TIME, 'yyyy-MM-dd HH:mm:ss'), 1, DT.TIMESUB) endTime
FROM ems_base_work_unit WU

@ -18,6 +18,8 @@
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="powerExpend" column="power_expend"/>
<result property="powerValue" column="power_value"/>
</resultMap>
<sql id="selectEmsReportPointDnbVo">
@ -26,6 +28,8 @@
ebmi.monitor_name,
erpd.instrument_value,
erpd.expend,
erpd.power_expend,
erpd.power_value,
erpd.record_time,
erpd.begin_time,
erpd.end_time,
@ -72,6 +76,8 @@
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="powerExpend != null">power_expend,</if>
<if test="powerValue != null">power_value,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="monitorCode != null">#{monitorCode},</if>
@ -85,6 +91,8 @@
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="powerExpend != null">#{powerExpend},</if>
<if test="powerValue != null">#{powerValue},</if>
</trim>
</insert>
@ -102,6 +110,8 @@
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="powerExpend != null">power_expend = #{powerExpend},</if>
<if test="powerValue != null">power_value = #{powerValue},</if>
</trim>
where obj_id = #{objId}
</update>

@ -61,6 +61,34 @@ public class ERPParamDto {
@JsonProperty(value = "TaskCode")
private String TaskCode;
/**
*
*/
@JsonProperty(value = "PlanStartTime")
private String PlanStartTime;
/**
*
*/
@JsonProperty(value = "PlanEndTime")
private String PlanEndTime;
public String getPlanStartTime() {
return PlanStartTime;
}
public void setPlanStartTime(String planStartTime) {
PlanStartTime = planStartTime;
}
public String getPlanEndTime() {
return PlanEndTime;
}
public void setPlanEndTime(String planEndTime) {
PlanEndTime = planEndTime;
}
public String getTaskCode() {
return TaskCode;
}

@ -47,7 +47,7 @@ public class ERPStaffSalary
private String groupId;
/** 事件日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JsonProperty(value = "EventDate")
private Date eventDate;

@ -54,4 +54,10 @@ public interface IERPPortService {
*/
String getERPProductionPlan(ERPParamDto paramDto);
/**
* ERP
* @param paramDto
*/
void getProductionPlanTask(ERPParamDto paramDto);
}

@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.os.common.utils.StringUtils;
import com.os.mes.api.domain.*;
import com.os.mes.api.service.IERPPortService;
@ -24,10 +25,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.*;
/**
@ -176,7 +174,7 @@ public class ERPPortServiceImpl implements IERPPortService {
erpStaffSalary.setController(ERPConstants.addSalaryController);
erpStaffSalary.setActionName(ERPConstants.addSalaryActionName);
erpStaffSalary.setIdCard(recordStaffSalary.getIdCard());
erpStaffSalary.setGroupId(recordStaffSalary.getGroupId());
// erpStaffSalary.setGroupId(recordStaffSalary.getGroupId());
erpStaffSalary.setEventDate(recordStaffSalary.getEventDate());
erpStaffSalary.setSalaryCategory(recordStaffSalary.getSalaryCategory());
erpStaffSalary.setRevenueClass(recordStaffSalary.getRevenueClass());
@ -185,22 +183,24 @@ public class ERPPortServiceImpl implements IERPPortService {
try {
// 创建ObjectMapper实例 对象转JSON字符串
ObjectMapper objectMapper = new ObjectMapper();
// objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
// objectMapper.setTimeZone(TimeZone.getTimeZone("UTC"));
objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.UPPER_CAMEL_CASE);
requestParam = objectMapper.writeValueAsString(erpStaffSalary);
// result = ApiUtils.sendERPHttpPost(ERPConstants.ERP_URL, requestParam);
result = "{\n" +
"\t\"Successful\": true,\n" +
"\t\"ErrorMessage\": null,\n" +
"\t\"Logined\": false,\n" +
"\t\"ReturnData\": {\n" +
"\t\t\"data\": {\n" +
"\t\t\t\"ObjectId\": \"25ff81b4-fb0b-4f1c-b9b1-6a2afab1cd0f\"\n" +
"\t\t},\n" +
"\t\t\"result\": \"success\",\n" +
"\t\t\"message\": \"创建成功!\"\n" +
"\t},\n" +
"\t\"DataType\": 0\n" +
"}";
result = ApiUtils.sendERPHttpPost(ERPConstants.ERP_URL, requestParam);
// result = "{\n" +
// "\t\"Successful\": true,\n" +
// "\t\"ErrorMessage\": null,\n" +
// "\t\"Logined\": false,\n" +
// "\t\"ReturnData\": {\n" +
// "\t\t\"data\": {\n" +
// "\t\t\t\"ObjectId\": \"25ff81b4-fb0b-4f1c-b9b1-6a2afab1cd0f\"\n" +
// "\t\t},\n" +
// "\t\t\"result\": \"success\",\n" +
// "\t\t\"message\": \"创建成功!\"\n" +
// "\t},\n" +
// "\t\"DataType\": 0\n" +
// "}";
// 处理接口返回消息
ObjectMapper resultMapper = new ObjectMapper();
// 将 JSON 字符串转换为 Java 对象
@ -208,6 +208,7 @@ public class ERPPortServiceImpl implements IERPPortService {
HashMap returnData = (HashMap) hashMap.get("ReturnData");
HashMap<String, Object> data = (HashMap<String, Object>) returnData.get("data");
objectId = String.valueOf(data.get("ObjectId"));
logger.info("新增【薪资明细】成功:" + requestParam + "|" + result);
} catch (Exception e) {
logger.warn("新增【薪资明细】异常:" + requestParam + "|" + result + "|" + e);
}
@ -233,9 +234,6 @@ public class ERPPortServiceImpl implements IERPPortService {
if (StringUtils.isEmpty(paramDto.getActionName())) {
paramDto.setActionName(ERPConstants.planActionName);
}
if (StringUtils.isEmpty(paramDto.getTaskCode())) {
return null;
}
try {
// 创建ObjectMapper实例 对象转JSON字符串
@ -260,4 +258,13 @@ public class ERPPortServiceImpl implements IERPPortService {
}
/**
* ERP
* @param paramDto
*/
@Override
public void getProductionPlanTask(ERPParamDto paramDto) {
this.getERPProductionPlan(paramDto);
}
}

@ -29,7 +29,7 @@ public class ERPConstants {
//获取【发布订单】
public static final String orderAppCode = "Afb7b276a38a04d52b7bd4ca314a42b0c";
public static final String orderController = "ReleaseOrderApiController";
public static final String orderActionName = "GetReleaseOrders";
public static final String orderActionName = "_GetReleaseOrders";
//最新工资系数
@ -52,4 +52,8 @@ public class ERPConstants {
public static final String planController = "ProductionPlanApiController";
public static final String planActionName = "GetProductionPlan";
//上传生产计划管理个人详情
public static final String personalDetailsAppCode = "Afb7b276a38a04d52b7bd4ca314a42b0c";
public static final String personalDetailsController = "ProductionPlanApiController";
public static final String personalDetailsActionName = "SendPersonalDetails";
}

@ -85,6 +85,25 @@ public class BaseDeviceLedger extends BaseEntity
@Excel(name = "资产编号")
private String assetCode;
private String processCode;
private String processName;
public String getProcessCode() {
return processCode;
}
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
public String getProcessName() {
return processName;
}
public void setProcessName(String processName) {
this.processName = processName;
}
public String getProductLineName() {
return productLineName;
}

@ -64,4 +64,12 @@ public interface BaseDeviceLedgerMapper
* @return
*/
public String getDeviceCode();
/**
*
*
* @param deviceCode
* @return
*/
public BaseDeviceLedger selectBaseDeviceLedgerByDeviceCode(String deviceCode);
}

@ -0,0 +1,100 @@
package com.os.mes.prod.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.os.common.annotation.Log;
import com.os.common.core.controller.BaseController;
import com.os.common.core.domain.AjaxResult;
import com.os.common.enums.BusinessType;
import com.os.mes.prod.domain.ProdPlanExecuteUser;
import com.os.mes.prod.service.IProdPlanExecuteUserService;
import com.os.common.utils.poi.ExcelUtil;
import com.os.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Yinq
* @date 2024-09-26
*/
@RestController
@RequestMapping("/mes/prod/planExecuteUser")
public class ProdPlanExecuteUserController extends BaseController {
@Autowired
private IProdPlanExecuteUserService prodPlanExecuteUserService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/prod:planExecuteUser:list')")
@GetMapping("/list")
public TableDataInfo list(ProdPlanExecuteUser prodPlanExecuteUser) {
startPage();
List<ProdPlanExecuteUser> list = prodPlanExecuteUserService.selectProdPlanExecuteUserList(prodPlanExecuteUser);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/prod:planExecuteUser:export')")
@Log(title = "生产工单执行用户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProdPlanExecuteUser prodPlanExecuteUser) {
List<ProdPlanExecuteUser> list = prodPlanExecuteUserService.selectProdPlanExecuteUserList(prodPlanExecuteUser);
ExcelUtil<ProdPlanExecuteUser> util = new ExcelUtil<ProdPlanExecuteUser>(ProdPlanExecuteUser.class);
util.exportExcel(response, list, "生产工单执行用户数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/prod:planExecuteUser:query')")
@GetMapping(value = "/{objId}")
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
return success(prodPlanExecuteUserService.selectProdPlanExecuteUserByObjId(objId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/prod:planExecuteUser:add')")
@Log(title = "生产工单执行用户", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProdPlanExecuteUser prodPlanExecuteUser) {
prodPlanExecuteUser.setCreateBy(getUsername());
return toAjax(prodPlanExecuteUserService.insertProdPlanExecuteUser(prodPlanExecuteUser));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/prod:planExecuteUser:edit')")
@Log(title = "生产工单执行用户", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProdPlanExecuteUser prodPlanExecuteUser) {
prodPlanExecuteUser.setUpdateBy(getUsername());
return toAjax(prodPlanExecuteUserService.updateProdPlanExecuteUser(prodPlanExecuteUser));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('mes/prod:planExecuteUser:remove')")
@Log(title = "生产工单执行用户", businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}")
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(prodPlanExecuteUserService.deleteProdPlanExecuteUserByObjIds(objIds));
}
}

@ -154,9 +154,8 @@ public class ProdOrderInfo extends BaseEntity {
private String printName;
/**
*
* ERP0 1
*/
@Excel(name = "预留标识")
private String isFlag;
/**

@ -2,6 +2,7 @@ package com.os.mes.prod.domain;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -62,39 +63,39 @@ public class ProdPlanErpInfo extends BaseEntity
private String equipmentNo;
/** 准备时间(分) */
@Excel(name = "准备时间", readConverterExp = "分=")
@Excel(name = "准备时间")
private BigDecimal preparationDuration;
/** 收尾时间(分) */
@Excel(name = "收尾时间", readConverterExp = "分=")
@Excel(name = "收尾时间")
private BigDecimal windUpDuration;
/** 出布最小速度(米 / 分) */
@Excel(name = "出布最小速度", readConverterExp = "米=,/=,分=")
@Excel(name = "出布最小速度")
private BigDecimal clothMinimumSpeed;
/** 出布最大速度(米 / 分) */
@Excel(name = "出布最大速度", readConverterExp = "米=,/=,分=")
@Excel(name = "出布最大速度")
private BigDecimal clothMaximumSpeed;
/** 成型最小速度(米 / 分) */
@Excel(name = "成型最小速度", readConverterExp = "米=,/=,分=")
@Excel(name = "成型最小速度")
private BigDecimal formingMinimumSpeed;
/** 成型最大速度(米 / 分) */
@Excel(name = "成型最大速度", readConverterExp = "米=,/=,分=")
@Excel(name = "成型最大速度")
private BigDecimal formingMaximumSpeed;
/** 包胶最小速度(米 / 分) */
@Excel(name = "包胶最小速度", readConverterExp = "米=,/=,分=")
@Excel(name = "包胶最小速度")
private BigDecimal glueMinimumSpeed;
/** 包胶最大速度(米 / 分) */
@Excel(name = "包胶最大速度", readConverterExp = "米=,/=,分=")
@Excel(name = "包胶最大速度")
private BigDecimal glueMaximumSpeed;
/** 每锅硫化米数m */
@Excel(name = "每锅硫化米数", readConverterExp = "m=")
@Excel(name = "每锅硫化米数")
private BigDecimal sulfurizationLength;
/** 硫化机类型 */
@ -130,31 +131,31 @@ public class ProdPlanErpInfo extends BaseEntity
private String conveyorLengthSpecification;
/** 上胶厚度mm */
@Excel(name = "上胶厚度", readConverterExp = "m=m")
@Excel(name = "上胶厚度")
private BigDecimal upGlueThickness;
/** 上缓冲胶厚度mm */
@Excel(name = "上缓冲胶厚度", readConverterExp = "m=m")
@Excel(name = "上缓冲胶厚度")
private BigDecimal upBufferGlueThickness;
/** 下胶厚度mm */
@Excel(name = "下胶厚度", readConverterExp = "m=m")
@Excel(name = "下胶厚度")
private BigDecimal belowGlueThickness;
/** 下缓冲胶厚度mm */
@Excel(name = "下缓冲胶厚度", readConverterExp = "m=m")
@Excel(name = "下缓冲胶厚度")
private BigDecimal belowBufferGlueThickness;
/** 输送带宽度mm */
@Excel(name = "输送带宽度", readConverterExp = "m=m")
@Excel(name = "输送带宽度")
private BigDecimal beltWidth;
/** 客户要求输送带长度m */
@Excel(name = "客户要求输送带长度", readConverterExp = "m=")
@Excel(name = "客户要求输送带长度")
private BigDecimal customerRequestConveyorLength;
/** 压延生产米数m */
@Excel(name = "压延生产米数", readConverterExp = "m=")
@Excel(name = "压延生产米数")
private BigDecimal rollingProductionMeters;
/** 需要硫化米数 */
@ -178,27 +179,27 @@ public class ProdPlanErpInfo extends BaseEntity
private BigDecimal encapsulationMeters;
/** 工作速度(每小时) */
@Excel(name = "工作速度", readConverterExp = "每=小时")
@Excel(name = "工作速度")
private BigDecimal workSpeed;
/** 需要工时(小时) */
@Excel(name = "需要工时", readConverterExp = "小=时")
@Excel(name = "需要工时")
private BigDecimal workingHours;
/** 出布面积(㎡) */
@Excel(name = "出布面积", readConverterExp = "㎡=")
@Excel(name = "出布面积")
private BigDecimal distributionArea;
/** 包胶面积(㎡) */
@Excel(name = "包胶面积", readConverterExp = "㎡=")
@Excel(name = "包胶面积")
private BigDecimal encapsulationArea;
/** 硫化面积(㎡) */
@Excel(name = "硫化面积", readConverterExp = "㎡=")
@Excel(name = "硫化面积")
private BigDecimal vulcanizationArea;
/** 输送带总面积(㎡) */
@Excel(name = "输送带总面积", readConverterExp = "㎡=")
@Excel(name = "输送带总面积")
private BigDecimal conveyorTotalArea;
/** 胶料工艺 */
@ -214,7 +215,7 @@ public class ProdPlanErpInfo extends BaseEntity
private BigDecimal upGlueCoefficient;
/** 上胶标准用胶量KG */
@Excel(name = "上胶标准用胶量", readConverterExp = "K=G")
@Excel(name = "上胶标准用胶量")
private BigDecimal upGlueDosage;
/** 下胶使用胶料 */
@ -226,7 +227,7 @@ public class ProdPlanErpInfo extends BaseEntity
private BigDecimal belowGlueCoefficient;
/** 下胶标准用胶量KG */
@Excel(name = "下胶标准用胶量", readConverterExp = "K=G")
@Excel(name = "下胶标准用胶量")
private BigDecimal belowGlueDosage;
/** 缓冲/布胶使用胶料 */
@ -238,7 +239,7 @@ public class ProdPlanErpInfo extends BaseEntity
private BigDecimal bufferGlueCoefficient;
/** 缓冲胶标准用胶量KG */
@Excel(name = "缓冲胶标准用胶量", readConverterExp = "K=G")
@Excel(name = "缓冲胶标准用胶量")
private BigDecimal bufferGlueDosage;
/** 大布布料规格 */
@ -250,7 +251,7 @@ public class ProdPlanErpInfo extends BaseEntity
private BigDecimal largeClothFrictioningCoefficient;
/** 胶布标准用胶量KG */
@Excel(name = "胶布标准用胶量", readConverterExp = "K=G")
@Excel(name = "胶布标准用胶量")
private BigDecimal largeClothDosage;
/** 中间胶使用胶料 */
@ -262,7 +263,7 @@ public class ProdPlanErpInfo extends BaseEntity
private BigDecimal middleGlueCoefficient;
/** 中间胶标准用胶量KG */
@Excel(name = "中间胶标准用胶量", readConverterExp = "K=G")
@Excel(name = "中间胶标准用胶量")
private BigDecimal middleGlueDosage;
/** 设备使用限制 */
@ -289,9 +290,40 @@ public class ProdPlanErpInfo extends BaseEntity
@Excel(name = "组长")
private String groupLeader;
/** 小组编号 */
@Excel(name = "小组编号")
private String teamNo;
/** 人员活动详情 */
@Excel(name = "人员活动详情")
private List<String> personnelOperationDetails;
private List<HashMap<String, String>> personnelOperationDetails;
private String processCode;
private String stationCode;
public String getTeamNo() {
return teamNo;
}
public void setTeamNo(String teamNo) {
this.teamNo = teamNo;
}
public String getProcessCode() {
return processCode;
}
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
public String getStationCode() {
return stationCode;
}
public void setStationCode(String stationCode) {
this.stationCode = stationCode;
}
public void setObjId(Long objId)
{
@ -897,11 +929,11 @@ public class ProdPlanErpInfo extends BaseEntity
return groupLeader;
}
public List<String> getPersonnelOperationDetails() {
public List<HashMap<String, String>> getPersonnelOperationDetails() {
return personnelOperationDetails;
}
public void setPersonnelOperationDetails(List<String> personnelOperationDetails) {
public void setPersonnelOperationDetails(List<HashMap<String, String>> personnelOperationDetails) {
this.personnelOperationDetails = personnelOperationDetails;
}

@ -0,0 +1,436 @@
package com.os.mes.prod.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.os.common.annotation.Excel;
import com.os.common.core.domain.BaseEntity;
/**
* prod_plan_execute_user
*
* @author Yinq
* @date 2024-09-26
*/
public class ProdPlanExecuteUser extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long objId;
/**
*
*/
@Excel(name = "订单编号")
private String orderCode;
/**
*
*/
@Excel(name = "工单编号")
private String planCode;
/**
*
*/
@Excel(name = "工序编号")
private String processCode;
/**
*
*/
@Excel(name = "工位编号")
private String stationCode;
/**
*
*/
private String stationName;
/**
* ID
*/
@Excel(name = "员工ID")
private String staffId;
/**
*
*/
@Excel(name = "员工名称")
private String staffName;
/**
*
*/
@Excel(name = "生产米数")
private BigDecimal completeAmount;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "工单明细开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date planBeginDate;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "工单明细结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date planEndDate;
/**
* 0 1
*/
@Excel(name = "生成工资标识0未生成 1已生成")
private String isFlag;
/**
*
*/
@Excel(name = "创建人")
private String createdBy;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
/**
*
*/
@Excel(name = "更新人")
private String updatedBy;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
/**
*
*/
@Excel(name = "工资系数")
private BigDecimal wageCoefficient;
/**
* m
*/
@Excel(name = "客户要求输送带长度m")
private BigDecimal BeltRequiredLength;
/**
*
*/
@Excel(name = "成型面积")
@JsonProperty(value = "FormingArea")
private BigDecimal FormingArea;
/**
*
*/
@Excel(name = "硫化面积")
@JsonProperty(value = "SulfurizationArea")
private BigDecimal SulfurizationArea;
/**
*
*/
@Excel(name = "压延包胶面积")
@JsonProperty(value = "RollCoatingArea")
private BigDecimal RollCoatingArea;
/**
*
*/
@Excel(name = "压延出布面积")
@JsonProperty(value = "RolledFabricArea")
private BigDecimal RolledFabricArea;
/** 身份证 */
@Excel(name = "身份证")
private String idCard;
/**
*
*/
@Excel(name = "班组编号")
private String teamCode;
/**
*
*/
@Excel(name = "班组名称")
private String teamName;
/**
*
*/
@Excel(name = "生产次数(锅数)")
private String batchNumber;
/**
*
*/
@Excel(name = "输送带长度规格")
private String BeltLengthSpecifications;
/**
*
*/
private String offWorkTime;
public String getOffWorkTime() {
return offWorkTime;
}
public void setOffWorkTime(String offWorkTime) {
this.offWorkTime = offWorkTime;
}
public BigDecimal getRollCoatingArea() {
return RollCoatingArea;
}
public void setRollCoatingArea(BigDecimal rollCoatingArea) {
RollCoatingArea = rollCoatingArea;
}
public BigDecimal getRolledFabricArea() {
return RolledFabricArea;
}
public void setRolledFabricArea(BigDecimal rolledFabricArea) {
RolledFabricArea = rolledFabricArea;
}
public String getBeltLengthSpecifications() {
return BeltLengthSpecifications;
}
public void setBeltLengthSpecifications(String beltLengthSpecifications) {
BeltLengthSpecifications = beltLengthSpecifications;
}
public String getBatchNumber() {
return batchNumber;
}
public void setBatchNumber(String batchNumber) {
this.batchNumber = batchNumber;
}
public String getIdCard() {
return idCard;
}
public void setIdCard(String idCard) {
this.idCard = idCard;
}
public String getTeamCode() {
return teamCode;
}
public void setTeamCode(String teamCode) {
this.teamCode = teamCode;
}
public String getTeamName() {
return teamName;
}
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public BigDecimal getBeltRequiredLength() {
return BeltRequiredLength;
}
public void setBeltRequiredLength(BigDecimal beltRequiredLength) {
BeltRequiredLength = beltRequiredLength;
}
public BigDecimal getFormingArea() {
return FormingArea;
}
public void setFormingArea(BigDecimal formingArea) {
FormingArea = formingArea;
}
public BigDecimal getSulfurizationArea() {
return SulfurizationArea;
}
public void setSulfurizationArea(BigDecimal sulfurizationArea) {
SulfurizationArea = sulfurizationArea;
}
public BigDecimal getWageCoefficient() {
return wageCoefficient;
}
public void setWageCoefficient(BigDecimal wageCoefficient) {
this.wageCoefficient = wageCoefficient;
}
public String getStationName() {
return stationName;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
public void setObjId(Long objId) {
this.objId = objId;
}
public Long getObjId() {
return objId;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setPlanCode(String planCode) {
this.planCode = planCode;
}
public String getPlanCode() {
return planCode;
}
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
public String getProcessCode() {
return processCode;
}
public void setStationCode(String stationCode) {
this.stationCode = stationCode;
}
public String getStationCode() {
return stationCode;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getStaffId() {
return staffId;
}
public void setCompleteAmount(BigDecimal completeAmount) {
this.completeAmount = completeAmount;
}
public BigDecimal getCompleteAmount() {
return completeAmount;
}
public void setPlanBeginDate(Date planBeginDate) {
this.planBeginDate = planBeginDate;
}
public Date getPlanBeginDate() {
return planBeginDate;
}
public void setPlanEndDate(Date planEndDate) {
this.planEndDate = planEndDate;
}
public Date getPlanEndDate() {
return planEndDate;
}
public void setIsFlag(String isFlag) {
this.isFlag = isFlag;
}
public String getIsFlag() {
return isFlag;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Date getCreatedTime() {
return createdTime;
}
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedTime(Date updatedTime) {
this.updatedTime = updatedTime;
}
public Date getUpdatedTime() {
return updatedTime;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("orderCode", getOrderCode())
.append("planCode", getPlanCode())
.append("processCode", getProcessCode())
.append("stationCode", getStationCode())
.append("staffId", getStaffId())
.append("completeAmount", getCompleteAmount())
.append("planBeginDate", getPlanBeginDate())
.append("planEndDate", getPlanEndDate())
.append("isFlag", getIsFlag())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.toString();
}
}

@ -150,8 +150,8 @@ public class ProdPlanInfo extends BaseEntity {
@Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date planEndTime;
/** 工单状态0未开始 1执行中 2执行完成 3取消 */
@Excel(name = "工单状态", readConverterExp = "0=未开始,1=执行中,2=执行完成,3=取消")
/** 工单状态0未开始 1执行中 2执行完成 3取消 4待执行 */
@Excel(name = "工单状态", readConverterExp = "0=未开始,1=执行中,2=执行完成,3=取消,4=待执行")
private String planStatus;
/** 班次1早班 2小夜 3大夜 */
@ -162,8 +162,19 @@ public class ProdPlanInfo extends BaseEntity {
@Excel(name = "工序编号")
private String processCode;
/** 导入类型0=人工1=ERP */
private String importFlag;
private List<ProdPlanDetail> prodPlanDetailList;
public String getImportFlag() {
return importFlag;
}
public void setImportFlag(String importFlag) {
this.importFlag = importFlag;
}
public List<ProdPlanDetail> getProdPlanDetailList() {
return prodPlanDetailList;
}

@ -0,0 +1,69 @@
package com.os.mes.prod.mapper;
import java.util.List;
import com.os.mes.prod.domain.ProdPlanExecuteUser;
/**
* Mapper
*
* @author Yinq
* @date 2024-09-26
*/
public interface ProdPlanExecuteUserMapper {
/**
*
*
* @param objId
* @return
*/
public ProdPlanExecuteUser selectProdPlanExecuteUserByObjId(Long objId);
/**
*
*
* @param prodPlanExecuteUser
* @return
*/
public List<ProdPlanExecuteUser> selectProdPlanExecuteUserList(ProdPlanExecuteUser prodPlanExecuteUser);
/**
*
*
* @param prodPlanExecuteUser
* @return
*/
public int insertProdPlanExecuteUser(ProdPlanExecuteUser prodPlanExecuteUser);
/**
*
*
* @param prodPlanExecuteUser
* @return
*/
public int updateProdPlanExecuteUser(ProdPlanExecuteUser prodPlanExecuteUser);
/**
*
*
* @param objId
* @return
*/
public int deleteProdPlanExecuteUserByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteProdPlanExecuteUserByObjIds(Long[] objIds);
/**
*
*
* @param prodPlanExecuteUser
* @return
*/
List<ProdPlanExecuteUser> selectAggProdPlanExecuteUserList(ProdPlanExecuteUser prodPlanExecuteUser);
}

@ -0,0 +1,61 @@
package com.os.mes.prod.service;
import java.util.List;
import com.os.mes.prod.domain.ProdPlanExecuteUser;
/**
* Service
*
* @author Yinq
* @date 2024-09-26
*/
public interface IProdPlanExecuteUserService {
/**
*
*
* @param objId
* @return
*/
public ProdPlanExecuteUser selectProdPlanExecuteUserByObjId(Long objId);
/**
*
*
* @param prodPlanExecuteUser
* @return
*/
public List<ProdPlanExecuteUser> selectProdPlanExecuteUserList(ProdPlanExecuteUser prodPlanExecuteUser);
/**
*
*
* @param prodPlanExecuteUser
* @return
*/
public int insertProdPlanExecuteUser(ProdPlanExecuteUser prodPlanExecuteUser);
/**
*
*
* @param prodPlanExecuteUser
* @return
*/
public int updateProdPlanExecuteUser(ProdPlanExecuteUser prodPlanExecuteUser);
/**
*
*
* @param objIds
* @return
*/
public int deleteProdPlanExecuteUserByObjIds(Long[] objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteProdPlanExecuteUserByObjId(Long objId);
}

@ -3,6 +3,9 @@ package com.os.mes.prod.service.impl;
import java.util.List;
import com.os.common.utils.DateUtils;
import com.os.common.utils.StringUtils;
import com.os.mes.base.domain.BaseDeviceLedger;
import com.os.mes.base.mapper.BaseDeviceLedgerMapper;
import com.os.mes.prod.domain.ProdPlanInfo;
import com.os.mes.prod.service.IProdPlanInfoService;
import org.springframework.beans.factory.annotation.Autowired;
@ -26,6 +29,9 @@ public class ProdPlanErpInfoServiceImpl implements IProdPlanErpInfoService {
@Autowired
private IProdPlanInfoService prodPlanInfoService;
@Autowired
private BaseDeviceLedgerMapper deviceLedgerMapper;
/**
*
*
@ -104,6 +110,15 @@ public class ProdPlanErpInfoServiceImpl implements IProdPlanErpInfoService {
@Transactional
public void insertOrUpdateProdPlanErpInfoList(List<ProdPlanErpInfo> dataList) {
for (ProdPlanErpInfo planErpInfo : dataList) {
String equipmentNo = planErpInfo.getEquipmentNo();
if (StringUtils.isNotEmpty(equipmentNo)) {
BaseDeviceLedger deviceLedger = deviceLedgerMapper.selectBaseDeviceLedgerByDeviceCode(equipmentNo);
if (StringUtils.isNotNull(deviceLedger)){
// 出布、成型、包胶、硫化
planErpInfo.setStationCode(deviceLedger.getProductLineCode());
planErpInfo.setProcessCode(deviceLedger.getProcessCode());
}
}
String seqNo = planErpInfo.getSeqNo();
ProdPlanErpInfo selectErpInfo = new ProdPlanErpInfo();
selectErpInfo.setSeqNo(seqNo);
@ -118,8 +133,11 @@ public class ProdPlanErpInfoServiceImpl implements IProdPlanErpInfoService {
planInfo.setPlanAmount(planErpInfo.getCustomerRequestConveyorLength());
planInfo.setPlanBeginTime(planErpInfo.getPlanStartTime());
planInfo.setPlanEndTime(planErpInfo.getPlanEndTime());
planInfo.setDeviceCode(equipmentNo);
planInfo.setProcessCode(planErpInfo.getProcessCode());
planInfo.setStationCode(planErpInfo.getStationCode());
planInfo.setTeamCode(planErpInfo.getTeamNo());
prodPlanInfoService.updateProdPlanInfo(planInfo);
ProdPlanErpInfo prodPlanErpInfo = infoList.get(0);
planErpInfo.setObjId(prodPlanErpInfo.getObjId());
this.updateProdPlanErpInfo(planErpInfo);
@ -128,14 +146,17 @@ public class ProdPlanErpInfoServiceImpl implements IProdPlanErpInfoService {
planInfo.setPlanCode(planErpInfo.getSeqNo());
planInfo.setOrderCode(planErpInfo.getTaskCode());
planInfo.setPlanAmount(planErpInfo.getCustomerRequestConveyorLength());
// planInfo.setDeviceCode(planErpInfo.getResourceName());
planInfo.setDeviceCode(equipmentNo);
planInfo.setProcessCode(planErpInfo.getProcessCode());
planInfo.setStationCode(planErpInfo.getStationCode());
planInfo.setPlanBeginTime(planErpInfo.getPlanStartTime());
planInfo.setPlanEndTime(planErpInfo.getPlanEndTime());
planInfo.setTeamCode(planErpInfo.getTeamNo());
planInfo.setPlanStatus("0");
planInfo.setImportFlag("1");
prodPlanInfoService.insertProdPlanInfo(planInfo);
this.insertProdPlanErpInfo(planErpInfo);
}
}
}
}

@ -0,0 +1,87 @@
package com.os.mes.prod.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.os.mes.prod.mapper.ProdPlanExecuteUserMapper;
import com.os.mes.prod.domain.ProdPlanExecuteUser;
import com.os.mes.prod.service.IProdPlanExecuteUserService;
/**
* Service
*
* @author Yinq
* @date 2024-09-26
*/
@Service
public class ProdPlanExecuteUserServiceImpl implements IProdPlanExecuteUserService {
@Autowired
private ProdPlanExecuteUserMapper prodPlanExecuteUserMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public ProdPlanExecuteUser selectProdPlanExecuteUserByObjId(Long objId) {
return prodPlanExecuteUserMapper.selectProdPlanExecuteUserByObjId(objId);
}
/**
*
*
* @param prodPlanExecuteUser
* @return
*/
@Override
public List<ProdPlanExecuteUser> selectProdPlanExecuteUserList(ProdPlanExecuteUser prodPlanExecuteUser) {
return prodPlanExecuteUserMapper.selectAggProdPlanExecuteUserList(prodPlanExecuteUser);
}
/**
*
*
* @param prodPlanExecuteUser
* @return
*/
@Override
public int insertProdPlanExecuteUser(ProdPlanExecuteUser prodPlanExecuteUser) {
return prodPlanExecuteUserMapper.insertProdPlanExecuteUser(prodPlanExecuteUser);
}
/**
*
*
* @param prodPlanExecuteUser
* @return
*/
@Override
public int updateProdPlanExecuteUser(ProdPlanExecuteUser prodPlanExecuteUser) {
return prodPlanExecuteUserMapper.updateProdPlanExecuteUser(prodPlanExecuteUser);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteProdPlanExecuteUserByObjIds(Long[] objIds) {
return prodPlanExecuteUserMapper.deleteProdPlanExecuteUserByObjIds(objIds);
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteProdPlanExecuteUserByObjId(Long objId) {
return prodPlanExecuteUserMapper.deleteProdPlanExecuteUserByObjId(objId);
}
}

@ -52,6 +52,7 @@ public class ProdPlanInfoServiceImpl implements IProdPlanInfoService {
*/
@Override
public int insertProdPlanInfo(ProdPlanInfo prodPlanInfo) {
prodPlanInfo.setCreatedTime(DateUtils.getNowDate());
return prodPlanInfoMapper.insertProdPlanInfo(prodPlanInfo);
}
@ -63,6 +64,7 @@ public class ProdPlanInfoServiceImpl implements IProdPlanInfoService {
*/
@Override
public int updateProdPlanInfo(ProdPlanInfo prodPlanInfo) {
prodPlanInfo.setUpdatedTime(DateUtils.getNowDate());
return prodPlanInfoMapper.updateProdPlanInfo(prodPlanInfo);
}

@ -101,6 +101,82 @@ public class RecordStaffSalary extends BaseEntity
/** ERP数据的ObjectId */
private String objectId;
/** 工序编号 */
private String processCode;
/**
*
*/
private String orderCode;
/**
*
*/
@Excel(name = "工单编号")
private String planCode;
/**
* ERP0 1
*/
@Excel(name = "上传ERP标识0未上传 1已上传")
private String isErp;
/**
*
*/
@Excel(name = "生产米数")
private BigDecimal prodNumber;
private String staffId;
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public BigDecimal getProdNumber() {
return prodNumber;
}
public void setProdNumber(BigDecimal prodNumber) {
this.prodNumber = prodNumber;
}
public String getPlanCode() {
return planCode;
}
public void setPlanCode(String planCode) {
this.planCode = planCode;
}
public String getIsErp() {
return isErp;
}
public void setIsErp(String isErp) {
this.isErp = isErp;
}
public String getOrderCode() {
return orderCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getProcessCode() {
return processCode;
}
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
public String getObjectId() {
return objectId;
}

@ -0,0 +1,122 @@
package com.os.mes.record.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.os.common.annotation.Excel;
import com.os.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
/**
*
*
* @author Yinq
* @date 2024-07-02
*/
public class ReportSalarySummary extends BaseEntity
{
private static final long serialVersionUID = 1L;
/**
*
*/
@Excel(name = "员工编号")
private String staffId;
/**
*
*/
@Excel(name = "员工名称")
private String staffName;
/** 身份证 */
@Excel(name = "身份证")
private String idCard;
/** 班组编号 */
@Excel(name = "班组编号")
private String groupId;
/**
*
*/
@Excel(name = "班组名称")
private String teamName;
/** 收入金额 */
@Excel(name = "收入金额")
private BigDecimal revenueAmount;
/** 事件日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "事件日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date eventDate;
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public String getTeamName() {
return teamName;
}
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
public String getIdCard() {
return idCard;
}
public void setIdCard(String idCard) {
this.idCard = idCard;
}
public Date getEventDate() {
return eventDate;
}
public void setEventDate(Date eventDate) {
this.eventDate = eventDate;
}
public BigDecimal getRevenueAmount() {
return revenueAmount;
}
public void setRevenueAmount(BigDecimal revenueAmount) {
this.revenueAmount = revenueAmount;
}
@Override
public String toString() {
return "ReportSalarySummary{" +
", staffName='" + staffName + '\'' +
", idCard='" + idCard + '\'' +
", eventDate=" + eventDate +
", revenueAmount=" + revenueAmount +
'}';
}
}

@ -0,0 +1,94 @@
package com.os.mes.record.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.os.common.annotation.Excel;
import com.os.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
/**
* record_staff_salary
*
* @author Yinq
* @date 2024-07-02
*/
public class StaffSalaryVo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/**
*
*/
private String processCode;
/**
* ID
*/
private String staffId;
/**
*
*/
private String staffName;
/** 工资系数 */
private BigDecimal salaryCoefficient;
/** 该工序所有员工工资系数 */
private BigDecimal sumSalaryCoefficient;
public String getProcessCode() {
return processCode;
}
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
public BigDecimal getSalaryCoefficient() {
return salaryCoefficient;
}
public void setSalaryCoefficient(BigDecimal salaryCoefficient) {
this.salaryCoefficient = salaryCoefficient;
}
public BigDecimal getSumSalaryCoefficient() {
return sumSalaryCoefficient;
}
public void setSumSalaryCoefficient(BigDecimal sumSalaryCoefficient) {
this.sumSalaryCoefficient = sumSalaryCoefficient;
}
@Override
public String toString() {
return "StaffSalaryVo{" +
"processCode='" + processCode + '\'' +
", staffId='" + staffId + '\'' +
", staffName='" + staffName + '\'' +
", salaryCoefficient=" + salaryCoefficient +
", sumSalaryCoefficient=" + sumSalaryCoefficient +
'}';
}
}

@ -1,8 +1,10 @@
package com.os.mes.record.mapper;
import java.util.List;
import java.util.Map;
import com.os.mes.record.domain.RecordStaffSalary;
import com.os.mes.record.domain.ReportSalarySummary;
/**
* Mapper
@ -58,4 +60,11 @@ public interface RecordStaffSalaryMapper {
* @return
*/
public int deleteRecordStaffSalaryByObjIds(Long[] objIds);
/**
*
* @param hashMap
* @return
*/
List<ReportSalarySummary> salarySummaryReport(Map hashMap);
}

@ -1,8 +1,10 @@
package com.os.mes.record.service;
import java.util.List;
import java.util.Map;
import com.os.mes.record.domain.RecordStaffSalary;
import com.os.mes.record.domain.ReportSalarySummary;
/**
* Service
@ -73,4 +75,11 @@ public interface IRecordStaffSalaryService {
* @return
*/
public int uploadERPStaffSalary(List<RecordStaffSalary> recordStaffSalaryList);
/**
*
* @param hashMap
* @return
*/
List<ReportSalarySummary> salarySummaryReport(Map hashMap);
}

@ -3,6 +3,9 @@ package com.os.mes.record.service.impl;
import java.util.List;
import com.os.common.utils.DateUtils;
import com.os.common.utils.StringUtils;
import com.os.mes.base.domain.BaseTeamMembers;
import com.os.mes.base.mapper.BaseTeamMembersMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.os.mes.record.mapper.RecordStaffAttendanceMapper;
@ -20,6 +23,9 @@ public class RecordStaffAttendanceServiceImpl implements IRecordStaffAttendanceS
@Autowired
private RecordStaffAttendanceMapper recordStaffAttendanceMapper;
@Autowired
private BaseTeamMembersMapper baseTeamMembersMapper;
/**
*
*
@ -39,7 +45,23 @@ public class RecordStaffAttendanceServiceImpl implements IRecordStaffAttendanceS
*/
@Override
public List<RecordStaffAttendance> selectRecordStaffAttendanceList(RecordStaffAttendance recordStaffAttendance) {
return recordStaffAttendanceMapper.selectRecordStaffAttendanceList(recordStaffAttendance);
List<RecordStaffAttendance> staffAttendanceList = recordStaffAttendanceMapper.selectRecordStaffAttendanceList(recordStaffAttendance);
List<BaseTeamMembers> teamMembers = baseTeamMembersMapper.selectBaseTeamMembersList(new BaseTeamMembers());
for (RecordStaffAttendance staffAttendance : staffAttendanceList) {
if (StringUtils.isEmpty(staffAttendance.getTeamCode())) {
continue;
}
for (BaseTeamMembers teamMember : teamMembers) {
if (staffAttendance.getTeamCode().contains(teamMember.getTeamCode())) {
if (StringUtils.isEmpty(staffAttendance.getTeamName())) {
staffAttendance.setTeamName(teamMember.getTeamName());
} else {
staffAttendance.setTeamName(staffAttendance.getTeamName() + "," + teamMember.getTeamName());
}
}
}
}
return staffAttendanceList;
}
/**

@ -3,6 +3,10 @@ package com.os.mes.record.service.impl;
import java.util.List;
import com.os.common.utils.DateUtils;
import com.os.common.utils.StringUtils;
import com.os.mes.base.domain.BaseTeamMembers;
import com.os.mes.base.mapper.BaseTeamMembersMapper;
import com.os.mes.record.domain.RecordStaffAttendance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.os.mes.record.mapper.RecordStaffCommuteMapper;
@ -20,6 +24,9 @@ public class RecordStaffCommuteServiceImpl implements IRecordStaffCommuteService
@Autowired
private RecordStaffCommuteMapper recordStaffCommuteMapper;
@Autowired
private BaseTeamMembersMapper baseTeamMembersMapper;
/**
*
*
@ -39,7 +46,23 @@ public class RecordStaffCommuteServiceImpl implements IRecordStaffCommuteService
*/
@Override
public List<RecordStaffCommute> selectRecordStaffCommuteList(RecordStaffCommute recordStaffCommute) {
return recordStaffCommuteMapper.selectRecordStaffCommuteList(recordStaffCommute);
List<RecordStaffCommute> staffCommuteList = recordStaffCommuteMapper.selectRecordStaffCommuteList(recordStaffCommute);
List<BaseTeamMembers> teamMembers = baseTeamMembersMapper.selectBaseTeamMembersList(new BaseTeamMembers());
for (RecordStaffCommute staffAttendance : staffCommuteList) {
if (StringUtils.isEmpty(staffAttendance.getTeamCode())) {
continue;
}
for (BaseTeamMembers teamMember : teamMembers) {
if (staffAttendance.getTeamCode().contains(teamMember.getTeamCode())) {
if (StringUtils.isEmpty(staffAttendance.getTeamName())) {
staffAttendance.setTeamName(teamMember.getTeamName());
} else {
staffAttendance.setTeamName(staffAttendance.getTeamName() + "," + teamMember.getTeamName());
}
}
}
}
return staffCommuteList;
}
/**

@ -3,31 +3,35 @@ package com.os.mes.record.service.impl;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
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.ProdPlanInfo;
import com.os.mes.prod.domain.ProdPlanExecuteUser;
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.mapper.RecordStaffCommuteMapper;
import com.os.mes.record.domain.ReportSalarySummary;
import com.os.mes.record.domain.StaffSalaryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.os.mes.record.mapper.RecordStaffSalaryMapper;
import com.os.mes.record.domain.RecordStaffSalary;
import com.os.mes.record.service.IRecordStaffSalaryService;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
@ -56,7 +60,7 @@ public class RecordStaffSalaryServiceImpl implements IRecordStaffSalaryService {
private BaseProcessInfoMapper baseProcessInfoMapper;
@Autowired
private RecordStaffCommuteMapper recordStaffCommuteMapper;
private ProdPlanExecuteUserMapper prodPlanExecuteUserMapper;
@Autowired
private IERPPortService portService;
@ -80,7 +84,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;
}
/**
@ -130,19 +150,216 @@ public class RecordStaffSalaryServiceImpl implements IRecordStaffSalaryService {
/**
*
* = **/
* =/*
* <p>
* 1
* 2
* 3 = * (/*) * (/)
*
* @param recordStaffSalary
* @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());
Map<String, Object> params = recordStaffSalary.getParams();
ProdPlanExecuteUser selectExecuteUser = new ProdPlanExecuteUser();
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("beginOffWorkTime")) {
beginOrderDate = DateUtils.parseDate(String.valueOf(params.get("beginOffWorkTime")));
}
if (params.containsKey("endOffWorkTime")) {
endOrderDate = DateUtils.parseDate(String.valueOf(params.get("endOffWorkTime")));
}
String taskCode = PlanCodeUtils.getTaskCode();
Map<String, List<ProdPlanExecuteUser>> offWorkTimeUserMap = planUserList.stream().collect(Collectors.groupingBy(ProdPlanExecuteUser::getOffWorkTime));
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;
}
}
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);
}
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();
}
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;
}
/**
*
*
* @param processCode
* @return
*/
public List<StaffSalaryVo> selectSumEmployeeSalary(String processCode) {
List<StaffSalaryVo> employeeList = new ArrayList<>();
BaseTeamMembers teamMembers = new BaseTeamMembers();
teamMembers.setProcessCode(processCode);
List<BaseTeamMembers> members = baseTeamMembersMapper.selectBaseTeamMembersList(teamMembers);
BigDecimal sumSalaryCoefficient = new BigDecimal(0);
for (BaseTeamMembers member : members) {
BaseStaffInfo staffInfo = new BaseStaffInfo();
staffInfo.setTeamCode(member.getTeamCode());
List<BaseStaffInfo> staffInfoList = baseStaffInfoMapper.selectBaseStaffInfoList(staffInfo);
for (BaseStaffInfo baseStaffInfo : staffInfoList) {
StaffSalaryVo salary = new StaffSalaryVo();
salary.setProcessCode(processCode);
salary.setStaffId(baseStaffInfo.getStaffId());
salary.setStaffName(baseStaffInfo.getStaffName());
salary.setSalaryCoefficient(baseStaffInfo.getWageCoefficient());
sumSalaryCoefficient = sumSalaryCoefficient.add(baseStaffInfo.getWageCoefficient());
boolean isRepeat = true;
for (StaffSalaryVo salaryVo : employeeList) {
if (salaryVo.getStaffId().equals(baseStaffInfo.getStaffId())) {
salaryVo.setSalaryCoefficient(salaryVo.getSumSalaryCoefficient().add(sumSalaryCoefficient));
isRepeat = false;
}
}
if (isRepeat) {
employeeList.add(salary);
}
}
}
for (StaffSalaryVo salaryVo : employeeList) {
salaryVo.setSumSalaryCoefficient(sumSalaryCoefficient);
}
return employeeList;
}
/* @Override
public List<RecordStaffSalary> selectTeamEmployeesWages(RecordStaffSalary recordStaffSalary) {
List<RecordStaffSalary> result = new ArrayList<>();
//调用最新工资系数接口
LatestSalary salaryData = portService.getERPLatestSalaryData(new ERPParamDto());
//遍历工序
List<BaseProcessInfo> processInfoList = baseProcessInfoMapper.selectBaseProcessInfoList(new BaseProcessInfo());
BaseProcessInfo selectProcessInfo = new BaseProcessInfo();
selectProcessInfo.setProcessCode(recordStaffSalary.getProcessCode());
List<BaseProcessInfo> processInfoList = baseProcessInfoMapper.selectBaseProcessInfoList(selectProcessInfo);
ProdPlanInfo planInfo = new ProdPlanInfo();
Map<String, Object> params = recordStaffSalary.getParams();
@ -256,95 +473,7 @@ public class RecordStaffSalaryServiceImpl implements IRecordStaffSalaryService {
}
return result;
}
// /**
// * 生成班组员工工资
// * @param recordStaffSalary
// * @return
// */
// @Override
// public List<RecordStaffSalary> selectTeamEmployeesWages(RecordStaffSalary recordStaffSalary) {
// List<RecordStaffSalary> result = new ArrayList<>();
// BaseTeamMembers members = new BaseTeamMembers();
// members.setTeamCode(recordStaffSalary.getGroupId());
// List<BaseTeamMembers> membersList = baseTeamMembersMapper.selectBaseTeamMembersList(members);
// //调用最新工资系数接口
// LatestSalary salaryData = portService.getERPLatestSalaryData(new ERPParamDto());
//
// ProdOrderInfo orderInfo = new ProdOrderInfo();
// Map<String, Object> params = recordStaffSalary.getParams();
// Date beginOrderDate = null;
// Date endOrderDate = null;
// if (params.containsKey("beginOrderDate")){
// beginOrderDate = DateUtils.parseDate(String.valueOf(params.get("beginOrderDate")));
// }
// if (params.containsKey("endOrderDate")){
// endOrderDate = DateUtils.parseDate(String.valueOf(params.get("endOrderDate")));
// }
// orderInfo.setParams(params);
// List<ProdOrderInfo> orderInfoList = prodOrderInfoMapper.selectProdOrderInfoList(orderInfo);
//
// long objId = 1L;
// String taskCode = PlanCodeUtils.getTaskCode();
// //按照班组 分工资;
// for (BaseTeamMembers team : membersList) {
// String processCode = team.getProcessCode();
// //工序工资系数
// BigDecimal coefficient = new BigDecimal(0);
// //工序生产面积
// BigDecimal totalArea = new BigDecimal(0);
//
// //硫化工序 工序硫化的工资 = 硫化系数*硫化面积*(工资系数/参加该工序的所有人的工资系数的总和)
// //硫化面积=硫化米数/客户要求总米数*硫化面积
// if(processCode.equals("1002")){
// coefficient = salaryData.getVulcanizationCoefficient();
// totalArea = orderInfoList.stream().map(ProdOrderInfo::getOrderDetail)
// .map(e -> e.getBeltRequiredLength().divide(e.getBeltRequiredLength(), 6, RoundingMode.HALF_UP)
// .multiply(e.getSulfurizationArea()))
// .reduce(BigDecimal.ZERO, BigDecimal::add);
// }
// //成型工序
// if(processCode.equals("1001")){
// coefficient = salaryData.getFormingCoefficient();
// totalArea = orderInfoList.stream().map(ProdOrderInfo::getOrderDetail)
// .map(e -> e.getBeltRequiredLength().divide(e.getBeltRequiredLength(), 6, RoundingMode.HALF_UP)
// .multiply(e.getFormingArea()))
// .reduce(BigDecimal.ZERO, BigDecimal::add);
// }
// //获取这个时间段内员工打卡记录
// BaseStaffInfo selectStaffInfo = new BaseStaffInfo();
// selectStaffInfo.setTeamCode(team.getTeamCode());
// selectStaffInfo.setDelFlag("0");
// List<BaseStaffInfo> staffInfoList = baseStaffInfoMapper.selectBaseStaffInfoList(selectStaffInfo);
// BigDecimal totalWageCoefficient = staffInfoList.stream().map(BaseStaffInfo::getWageCoefficient)
// .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
//
// for (BaseStaffInfo staffInfo : staffInfoList) {
// RecordStaffSalary staffSalary = new RecordStaffSalary();
// staffSalary.setObjId(objId++);
// staffSalary.setTaskCode(taskCode);
// staffSalary.setIdCard(staffInfo.getPassWord());
// staffSalary.setGroupId(team.getTeamCode());
// staffSalary.setEventDate(new Date());
// staffSalary.setSalaryCategory("收入");
// staffSalary.setRevenueClass("完成生产任务");
// BigDecimal staffCoefficient = staffInfo.getWageCoefficient().divide(totalWageCoefficient, 6, RoundingMode.HALF_UP);
// BigDecimal revenueAmount = coefficient.multiply(totalArea).multiply(staffCoefficient);
// revenueAmount = revenueAmount.setScale(2, RoundingMode.HALF_UP);
// staffSalary.setRevenueAmount(revenueAmount);
// staffSalary.setSalaryCoefficient(staffInfo.getWageCoefficient());
// staffSalary.setStaffName(staffInfo.getStaffName());
// staffSalary.setCardId(staffInfo.getCardId());
// staffSalary.setTeamName(team.getTeamName());
// staffSalary.setBeginDate(beginOrderDate);
// staffSalary.setEndDate(endOrderDate);
// result.add(staffSalary);
// }
//
// }
// return result;
// }
}*/
/**
*
@ -354,12 +483,18 @@ public class RecordStaffSalaryServiceImpl implements IRecordStaffSalaryService {
* @return
*/
@Override
@Transactional(rollbackFor = ServiceException.class)
public int uploadERPStaffSalary(List<RecordStaffSalary> recordStaffSalaryList) {
Thread thread = new Thread(() -> {
for (RecordStaffSalary staffSalary : recordStaffSalaryList) {
String objectId = portService.addSalaryBreakdown(staffSalary);
staffSalary.setObjectId(objectId);
recordStaffSalaryMapper.insertRecordStaffSalary(staffSalary);
//更新ERP上传标识
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(); //启动新线程
@ -367,4 +502,30 @@ public class RecordStaffSalaryServiceImpl implements IRecordStaffSalaryService {
return 1;
}
/**
*
* @param hashMap
* @return
*/
@Override
public List<ReportSalarySummary> salarySummaryReport(Map hashMap) {
List<ReportSalarySummary> summaryList = recordStaffSalaryMapper.salarySummaryReport(hashMap);
List<BaseTeamMembers> teamMembers = baseTeamMembersMapper.selectBaseTeamMembersList(new BaseTeamMembers());
for (ReportSalarySummary staffSalary : summaryList) {
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 summaryList;
}
}

@ -1,16 +1,23 @@
package com.os.mes.report.controller;
import java.util.HashMap;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.Map;
import com.os.common.core.page.TableDataInfo;
import com.os.common.utils.poi.ExcelUtil;
import com.os.mes.record.domain.ReportSalarySummary;
import com.os.mes.record.service.IRecordStaffSalaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.os.common.core.controller.BaseController;
import com.os.common.core.domain.AjaxResult;
import com.os.mes.report.domain.ReportBoardPort;
import com.os.mes.report.service.IReportBoardPortService;
import javax.servlet.http.HttpServletResponse;
/**
* Controller
*
@ -24,6 +31,9 @@ public class ReportBoardPortController extends BaseController
@Autowired
private IReportBoardPortService reportBoardPortService;
@Autowired
private IRecordStaffSalaryService recordStaffSalaryService;
/**
*
*/
@ -34,5 +44,38 @@ public class ReportBoardPortController extends BaseController
return success(list);
}
/**
*
* @param paramMap
* @return
*/
@PostMapping("/homeBoard")
public AjaxResult homeBoard(@RequestBody HashMap<String, String> paramMap)
{
HashMap<String, Object> list = reportBoardPortService.selectReportHomeBoard(paramMap);
return success(list);
}
/**
*
* @param hashMap
* @return
*/
@GetMapping("/salarySummaryReport")
public TableDataInfo salarySummaryReport(@RequestParam(required = false) Map hashMap) {
startPage();
List<ReportSalarySummary> list = recordStaffSalaryService.salarySummaryReport(hashMap);
return getDataTable(list);
}
/**
*
*/
@PostMapping("/salarySummaryReport/export" )
public void energyStatisticalReportListExport(HttpServletResponse response, @RequestParam(required = false) Map hashMap) {
List<ReportSalarySummary> list = recordStaffSalaryService.salarySummaryReport(hashMap);
ExcelUtil<ReportSalarySummary> util = new ExcelUtil<>(ReportSalarySummary. class);
util.exportExcel(response, list, "员工工资汇总报表" );
}
}

@ -1,5 +1,6 @@
package com.os.mes.report.service;
import java.util.HashMap;
import java.util.List;
import com.os.mes.report.domain.ReportBoardPort;
@ -20,4 +21,11 @@ public interface IReportBoardPortService
public List<ReportBoardPort> selectReportBoardPortList(ReportBoardPort reportBoardPort);
/**
*
* @param paramMap
* @return
*/
HashMap<String, Object> selectReportHomeBoard(HashMap<String, String> paramMap);
}

@ -1,6 +1,13 @@
package com.os.mes.report.service.impl;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import com.os.common.utils.DateUtils;
import com.os.mes.prod.domain.ProdOrderInfo;
import com.os.mes.prod.service.IProdOrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.os.mes.report.domain.ReportBoardPort;
import com.os.mes.report.service.IReportBoardPortService;
@ -15,8 +22,49 @@ import com.os.mes.report.service.IReportBoardPortService;
public class ReportBoardPortServiceImpl implements IReportBoardPortService
{
@Autowired
private IProdOrderInfoService prodOrderInfoService;
@Override
public List<ReportBoardPort> selectReportBoardPortList(ReportBoardPort reportBoardPort) {
return null;
}
/**
*
* @param paramMap
* @return
*/
@Override
public HashMap<String, Object> selectReportHomeBoard(HashMap<String, String> paramMap) {
//计划订单数量 在制订单数量 今日计划米数 今日完成米数
HashMap<String, Object> result = new HashMap<>();
ProdOrderInfo orderInfo = new ProdOrderInfo();
HashMap<String, Object> map = new HashMap<>();
String date = DateUtils.getDate() + " 00:00:00";
map.put("beginBeginDate", date);
map.put("endBeginDate", date);
orderInfo.setParams(map);
List<ProdOrderInfo> infoList = prodOrderInfoService.selectProdOrderInfoList(orderInfo);
Long planOrder = 0L;
Long makeOrder = 0L;
BigDecimal todayNumber = new BigDecimal(0);
BigDecimal finishNumber = new BigDecimal(0);
for (ProdOrderInfo prodOrderInfo : infoList) {
planOrder++;
todayNumber = todayNumber.add(prodOrderInfo.getOrderAmount());
if (prodOrderInfo.getOrderAmount().compareTo(prodOrderInfo.getCompleteAmount()) < 1){
makeOrder++;
finishNumber = finishNumber.add(prodOrderInfo.getOrderAmount());
}
}
result.put("planOrder", planOrder);
result.put("makeOrder", makeOrder);
result.put("todayNumber", todayNumber);
result.put("finishNumber", finishNumber);
return result;
}
}

@ -26,6 +26,8 @@
<result property="factoryCode" column="factory_code"/>
<result property="teamCode" column="team_code"/>
<result property="assetCode" column="asset_code"/>
<result property="processCode" column="process_code"/>
<result property="processName" column="process_name"/>
</resultMap>
<sql id="selectBaseDeviceLedgerVo">
@ -75,6 +77,7 @@
<if test="teamCode != null and teamCode != ''">and bdl.team_code = #{teamCode}</if>
<if test="assetCode != null and assetCode != ''">and bdl.asset_code = #{assetCode}</if>
</where>
order by bdl.device_code
</select>
<select id="selectBaseDeviceLedgerByObjId" parameterType="Long" resultMap="BaseDeviceLedgerResult">
@ -172,4 +175,9 @@
from base_deviceledger
</select>
<select id="selectBaseDeviceLedgerByDeviceCode" parameterType="String" resultMap="BaseDeviceLedgerResult">
<include refid="selectBaseDeviceLedgerVo"/>
where bdl.device_code = #{deviceCode}
</select>
</mapper>

@ -79,6 +79,7 @@
<if test="capacityDay != null ">and pl1.capacity_day = #{capacityDay}</if>
<if test="capacityMonth != null ">and pl1.capacity_month = #{capacityMonth}</if>
</where>
order by pl1.product_line_code
</select>
<select id="selectBaseProductLineByObjId" parameterType="Long" resultMap="BaseProductLineResult">

@ -160,7 +160,7 @@
<select id="selectProdOrderDetailList" parameterType="ProdOrderDetail" resultMap="ProdOrderDetailResult">
<include refid="selectProdOrderDetailVo"/>
<where>
<if test="SeqNo != null and SeqNo != ''">and SeqNo = #{SeqNo}</if>
<if test="SeqNo != null and SeqNo != ''">and SeqNo like concat('%', #{SeqNo}, '%')</if>
<if test="params.beginOrderDate != null and params.beginOrderDate != '' and params.endOrderDate != null and params.endOrderDate != ''">
and OrderDate between #{params.beginOrderDate} and #{params.endOrderDate}
</if>
@ -186,6 +186,7 @@
<if test="EdgeBandingTotalArea != null ">and EdgeBandingTotalArea = #{EdgeBandingTotalArea}</if>
<if test="WireropeBeltTotalArea != null ">and WireropeBeltTotalArea = #{WireropeBeltTotalArea}</if>
</where>
order by SeqNo desc
</select>
<select id="selectProdOrderDetailByObjId" parameterType="Long" resultMap="ProdOrderDetailResult">

@ -213,7 +213,7 @@
<select id="selectProdOrderInfoList" parameterType="ProdOrderInfo" resultMap="ProdOrderInfoResult">
<include refid="selectProdOrderInfoVo"/>
<where>
<if test="orderCode != null and orderCode != ''">and poi.order_code = #{orderCode}</if>
<if test="orderCode != null and orderCode != ''">and poi.order_code like concat('%', #{orderCode}, '%')</if>
<if test="saleOrderCode != null and saleOrderCode != ''">and poi.sale_order_code = #{saleOrderCode}</if>
<if test="saleOrderLineNumber != null and saleOrderLineNumber != ''">and sale_order_line_number =
#{saleOrderLineNumber}
@ -249,6 +249,7 @@
and pod.OrderDate between #{params.beginOrderDate} and #{params.endOrderDate}
</if>
</where>
order by poi.order_code desc
</select>
<select id="selectProdOrderInfoByObjId" parameterType="Long" resultMap="ProdOrderInfoResult">

@ -0,0 +1,211 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.os.mes.prod.mapper.ProdPlanExecuteUserMapper">
<resultMap type="ProdPlanExecuteUser" id="ProdPlanExecuteUserResult">
<result property="objId" column="obj_id"/>
<result property="orderCode" column="order_code"/>
<result property="planCode" column="plan_code"/>
<result property="processCode" column="process_code"/>
<result property="stationCode" column="station_code"/>
<result property="staffId" column="staff_id"/>
<result property="completeAmount" column="complete_amount"/>
<result property="planBeginDate" column="plan_begin_date"/>
<result property="planEndDate" column="plan_end_date"/>
<result property="isFlag" column="is_flag"/>
<result property="createdBy" column="created_by"/>
<result property="createdTime" column="created_time"/>
<result property="updatedBy" column="updated_by"/>
<result property="updatedTime" column="updated_time"/>
<result property="offWorkTime" column="off_work_time"/>
<result property="batchNumber" column="batch_number"/>
<result property="staffName" column="staff_name"/>
<result property="stationName" column="station_name"/>
<result property="wageCoefficient" column="wage_coefficient"/>
<result property="BeltRequiredLength" column="BeltRequiredLength"/>
<result property="FormingArea" column="FormingArea"/>
<result property="SulfurizationArea" column="SulfurizationArea"/>
<result property="idCard" column="pass_word"/>
<result property="teamCode" column="team_code"/>
<result property="BeltLengthSpecifications" column="BeltLengthSpecifications"/>
<result property="RollCoatingArea" column="RollCoatingArea"/>
<result property="RolledFabricArea" column="RolledFabricArea"/>
</resultMap>
<sql id="selectProdPlanExecuteUserVo">
select ppeu.obj_id,
ppeu.order_code,
ppeu.plan_code,
ppeu.process_code,
ppeu.station_code,
ppeu.staff_id,
ppeu.complete_amount,
ppeu.plan_begin_date,
ppeu.plan_end_date,
ppeu.is_flag,
ppeu.created_by,
ppeu.created_time,
ppeu.updated_by,
ppeu.updated_time,
ppeu.batch_number,
FORMAT(ppeu.off_work_time, 'yyyy-MM-dd') off_work_time,
bsi.staff_name,
bsi.wage_coefficient,
bpl.product_line_name station_name,
pod.BeltRequiredLength,
pod.SulfurizationArea,
pod.RolledFabricArea,
pod.RollCoatingArea,
pod.FormingArea,
bsi.pass_word,
bsi.team_code,
pod.BeltLengthSpecifications
from prod_plan_execute_user ppeu
left join base_staff_info bsi on bsi.staff_id = ppeu.staff_id
left join base_product_line bpl on bpl.product_line_code = ppeu.station_code
left join prod_order_detail pod on ppeu.order_code = pod.SeqNo
</sql>
<select id="selectProdPlanExecuteUserList" parameterType="ProdPlanExecuteUser"
resultMap="ProdPlanExecuteUserResult">
<include refid="selectProdPlanExecuteUserVo"/>
<where>
<if test="orderCode != null and orderCode != ''">and ppeu.order_code = #{orderCode}</if>
<if test="planCode != null and planCode != ''">and ppeu.plan_code = #{planCode}</if>
<if test="processCode != null and processCode != ''">and ppeu.process_code = #{processCode}</if>
<if test="stationCode != null and stationCode != ''">and ppeu.station_code = #{stationCode}</if>
<if test="staffId != null and staffId != ''">and ppeu.staff_id = #{staffId}</if>
<if test="completeAmount != null ">and ppeu.complete_amount = #{completeAmount}</if>
<if test="planBeginDate != null ">and ppeu.plan_begin_date = #{planBeginDate}</if>
<if test="planEndDate != null ">and ppeu.plan_end_date = #{planEndDate}</if>
<if test="isFlag != null and isFlag != ''">and ppeu.is_flag = #{isFlag}</if>
<if test="batchNumber != null and batchNumber != ''">and ppeu.batch_number = #{batchNumber}</if>
<if test="params.beginOrderDate != null and params.beginOrderDate != '' and params.endOrderDate != null and params.endOrderDate != ''">
and FORMAT(ppeu.plan_end_date, 'yyyy-MM-dd') between #{params.beginOrderDate} and #{params.endOrderDate}
</if>
<if test="params.beginOffWorkTime != null and params.beginOffWorkTime != '' and params.endOffWorkTime != null and params.endOffWorkTime != ''">
and FORMAT(ppeu.off_work_time, 'yyyy-MM-dd') between #{params.beginOffWorkTime} and #{params.endOffWorkTime}
</if>
</where>
</select>
<select id="selectProdPlanExecuteUserByObjId" parameterType="Long" resultMap="ProdPlanExecuteUserResult">
<include refid="selectProdPlanExecuteUserVo"/>
where obj_id = #{objId}
</select>
<select id="selectAggProdPlanExecuteUserList" parameterType="ProdPlanExecuteUser" resultMap="ProdPlanExecuteUserResult">
SELECT ppeu.order_code,
ppeu.plan_code,
ppeu.process_code,
ppeu.station_code,
bpl.product_line_name AS station_name,
ppeu.complete_amount,
ppeu.plan_begin_date,
ppeu.plan_end_date,
ppeu.batch_number,
STUFF(
(SELECT DISTINCT ', ' + CAST(ppeu_inner.staff_id AS VARCHAR)
FROM prod_plan_execute_user ppeu_inner
WHERE ppeu_inner.plan_code = ppeu.plan_code
AND ppeu_inner.batch_number = ppeu.batch_number
FOR XML PATH('')), 1, 2, '') AS staff_id,
STUFF(
(SELECT DISTINCT ', ' + bsi.staff_name
FROM base_staff_info bsi
LEFT JOIN prod_plan_execute_user ppeu_inner ON ppeu_inner.staff_id = bsi.staff_id
WHERE ppeu_inner.plan_code = ppeu.plan_code
AND ppeu_inner.batch_number = ppeu.batch_number
FOR XML PATH('')), 1, 2, '') AS staff_name
FROM prod_plan_execute_user ppeu
LEFT JOIN base_product_line bpl ON bpl.product_line_code = ppeu.station_code
<where>
<if test="orderCode != null and orderCode != ''">and ppeu.order_code = #{orderCode}</if>
<if test="planCode != null and planCode != ''">and ppeu.plan_code = #{planCode}</if>
<if test="processCode != null and processCode != ''">and ppeu.process_code = #{processCode}</if>
<if test="stationCode != null and stationCode != ''">and ppeu.station_code = #{stationCode}</if>
<if test="staffId != null and staffId != ''">and ppeu.staff_id = #{staffId}</if>
<if test="completeAmount != null ">and ppeu.complete_amount = #{completeAmount}</if>
<if test="planBeginDate != null ">and ppeu.plan_begin_date = #{planBeginDate}</if>
<if test="planEndDate != null ">and ppeu.plan_end_date = #{planEndDate}</if>
<if test="isFlag != null and isFlag != ''">and ppeu.is_flag = #{isFlag}</if>
<if test="batchNumber != null and batchNumber != ''">and ppeu.batch_number = #{batchNumber}</if>
<if test="params.beginOrderDate != null and params.beginOrderDate != '' and params.endOrderDate != null and params.endOrderDate != ''">
and FORMAT(ppeu.plan_end_date, 'yyyy-MM-dd') between #{params.beginOrderDate} and #{params.endOrderDate}
</if>
</where>
GROUP BY ppeu.order_code, ppeu.plan_code, ppeu.process_code, ppeu.station_code, bpl.product_line_name,
ppeu.complete_amount, ppeu.plan_begin_date, ppeu.plan_end_date, ppeu.batch_number
ORDER BY ppeu.order_code desc, ppeu.station_code, ppeu.batch_number
</select>
<insert id="insertProdPlanExecuteUser" parameterType="ProdPlanExecuteUser" useGeneratedKeys="true"
keyProperty="objId">
insert into prod_plan_execute_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderCode != null">order_code,</if>
<if test="planCode != null">plan_code,</if>
<if test="processCode != null">process_code,</if>
<if test="stationCode != null">station_code,</if>
<if test="staffId != null">staff_id,</if>
<if test="completeAmount != null">complete_amount,</if>
<if test="planBeginDate != null">plan_begin_date,</if>
<if test="planEndDate != null">plan_end_date,</if>
<if test="isFlag != null">is_flag,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderCode != null">#{orderCode},</if>
<if test="planCode != null">#{planCode},</if>
<if test="processCode != null">#{processCode},</if>
<if test="stationCode != null">#{stationCode},</if>
<if test="staffId != null">#{staffId},</if>
<if test="completeAmount != null">#{completeAmount},</if>
<if test="planBeginDate != null">#{planBeginDate},</if>
<if test="planEndDate != null">#{planEndDate},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
</trim>
</insert>
<update id="updateProdPlanExecuteUser" parameterType="ProdPlanExecuteUser">
update prod_plan_execute_user
<trim prefix="SET" suffixOverrides=",">
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="planCode != null">plan_code = #{planCode},</if>
<if test="processCode != null">process_code = #{processCode},</if>
<if test="stationCode != null">station_code = #{stationCode},</if>
<if test="staffId != null">staff_id = #{staffId},</if>
<if test="completeAmount != null">complete_amount = #{completeAmount},</if>
<if test="planBeginDate != null">plan_begin_date = #{planBeginDate},</if>
<if test="planEndDate != null">plan_end_date = #{planEndDate},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteProdPlanExecuteUserByObjId" parameterType="Long">
delete
from prod_plan_execute_user
where obj_id = #{objId}
</delete>
<delete id="deleteProdPlanExecuteUserByObjIds" parameterType="String">
delete from prod_plan_execute_user where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>

@ -29,6 +29,7 @@
<result property="planStatus" column="plan_status"/>
<result property="classes" column="classes"/>
<result property="processCode" column="process_code"/>
<result property="importFlag" column="import_flag"/>
<collection property="prodPlanDetailList" javaType="java.util.List" resultMap="ProdPlanDetailResult"/>
</resultMap>
@ -68,7 +69,10 @@
ppi.updated_by,
ppi.updated_time,
ppi.plan_begin_time,
ppi.plan_end_time
ppi.plan_end_time,
ppi.plan_status,
ppi.process_code,
ppi.import_flag
from prod_plan_info ppi
left join base_product_line bpl on bpl.product_line_code = ppi.station_code
left join base_team_members btm on btm.team_code = ppi.team_code
@ -177,6 +181,7 @@
<if test="planStatus != null">plan_status,</if>
<if test="classes != null">classes,</if>
<if test="processCode != null">process_code,</if>
<if test="importFlag != null">import_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planCode != null and planCode != ''">#{planCode},</if>
@ -200,6 +205,7 @@
<if test="planStatus != null">#{planStatus},</if>
<if test="classes != null">#{classes},</if>
<if test="processCode != null">#{processCode},</if>
<if test="importFlag != null">#{importFlag},</if>
</trim>
</insert>
@ -227,6 +233,7 @@
<if test="planStatus != null">plan_status = #{planStatus},</if>
<if test="classes != null">classes = #{classes},</if>
<if test="processCode != null">process_code = #{processCode},</if>
<if test="importFlag != null">import_flag = #{importFlag},</if>
</trim>
where obj_id = #{objId}
</update>
@ -251,7 +258,7 @@
<if test="orderCode != null and orderCode != ''">and ppi.order_code = #{orderCode}</if>
<if test="processCode != null and processCode != ''">and ppi.process_code = #{processCode}</if>
<if test="params.beginOrderDate != null and params.beginOrderDate != '' and params.endOrderDate != null and params.endOrderDate != ''">
and LEFT(CONVERT(VARCHAR(17), ppd.begin_time, 120), 10) between #{params.beginOrderDate} and #{params.endOrderDate}
and ppd.end_time between #{params.beginOrderDate} and #{params.endOrderDate}
</if>
</where>
</select>

@ -27,7 +27,6 @@
bsi.staff_name,
rsa.attendance_type,
rsa.team_code,
btm.team_name,
rsa.classes,
rsa.remark,
rsa.is_flag,
@ -37,7 +36,6 @@
rsa.update_time,
rsa.machine_code
from record_staff_attendance rsa
left join base_team_members btm on btm.team_code = rsa.team_code
left join base_staff_info bsi on bsi.staff_id = rsa.staff_id
</sql>

@ -30,7 +30,6 @@
rsc.staff_id,
bsi.staff_name,
rsc.team_code,
btm.team_name,
rsc.classes,
rsc.start_work_time,
rsc.end_work_time,
@ -46,7 +45,6 @@
bsi.pass_word
from record_staff_commute rsc
left join base_staff_info bsi on bsi.staff_id = rsc.staff_id
left join base_team_members btm on btm.team_code = rsc.team_code
</sql>
<select id="selectRecordStaffCommuteList" parameterType="RecordStaffCommute" resultMap="RecordStaffCommuteResult">

@ -25,6 +25,11 @@
<result property="objectId" column="object_id"/>
<result property="staffName" column="staff_name"/>
<result property="teamName" column="team_name"/>
<result property="orderCode" column="order_code"/>
<result property="planCode" column="plan_code"/>
<result property="isErp" column="is_erp"/>
<result property="prodNumber" column="prod_number"/>
<result property="staffId" column="staff_id"/>
</resultMap>
<sql id="selectRecordStaffSalaryVo">
@ -45,11 +50,13 @@
rss.object_id,
rss.begin_date,
rss.end_date,
bsi.staff_name,
btm.team_name
rss.order_code,
rss.plan_code,
rss.is_erp,
rss.prod_number,
bsi.staff_name
from record_staff_salary rss
left join base_staff_info bsi on rss.id_card = bsi.pass_word
left join base_team_members btm on rss.group_id = btm.team_code
</sql>
<select id="selectRecordStaffSalaryList" parameterType="RecordStaffSalary" resultMap="RecordStaffSalaryResult">
@ -58,7 +65,7 @@
<if test="idCard != null and idCard != ''">and rss.id_card = #{idCard}</if>
<if test="groupId != null and groupId != ''">and rss.group_id = #{groupId}</if>
<if test="params.beginEventDate != null and params.beginEventDate != '' and params.endEventDate != null and params.endEventDate != ''">
and rss.event_date between #{params.beginEventDate} and #{params.endEventDate}
and FORMAT(rss.event_date, 'yyyy-MM-dd') between #{params.beginEventDate} and #{params.endEventDate}
</if>
<if test="salaryCategory != null and salaryCategory != ''">and rss.salary_category = #{salaryCategory}</if>
<if test="revenueClass != null and revenueClass != ''">and rss.revenue_class = #{revenueClass}</if>
@ -70,8 +77,14 @@
<if test="taskCode != null and taskCode != ''">and rss.task_code = #{taskCode}</if>
<if test="salaryCoefficient != null ">and rss.salary_coefficient = #{salaryCoefficient}</if>
<if test="objectId != null ">and rss.object_id = #{objectId}</if>
<if test="isErp != null and isErp != ''">and rss.is_erp = #{isErp}</if>
<if test="orderCode != null and orderCode != ''">and rss.order_code like concat('%', #{orderCode}, '%')</if>
<if test="planCode != null and planCode != ''">and rss.plan_code like concat('%', #{planCode}, '%')</if>
<if test="params.beginOffWorkTime != null and params.beginOffWorkTime != '' and params.endOffWorkTime != null and params.endOffWorkTime != ''">
and FORMAT(rss.event_date, 'yyyy-MM-dd') between #{params.beginOffWorkTime} and #{params.endOffWorkTime}
</if>
</where>
order by rss.task_code desc, rss.group_id
order by rss.event_date, rss.group_id, rss.id_card
</select>
<select id="selectRecordStaffSalaryByObjId" parameterType="Long" resultMap="RecordStaffSalaryResult">
@ -98,6 +111,10 @@
<if test="beginDate != null">begin_date,</if>
<if test="endDate != null">end_date,</if>
<if test="objectId != null">object_id,</if>
<if test="orderCode != null">order_code,</if>
<if test="planCode != null">plan_code,</if>
<if test="isErp != null">is_erp,</if>
<if test="prodNumber != null">prod_number,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="idCard != null">#{idCard},</if>
@ -116,6 +133,10 @@
<if test="beginDate != null">#{beginDate},</if>
<if test="endDate != null">#{endDate},</if>
<if test="objectId != null">#{objectId},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="planCode != null">#{planCode},</if>
<if test="isErp != null">#{isErp},</if>
<if test="prodNumber != null">#{prodNumber},</if>
</trim>
</insert>
@ -138,6 +159,10 @@
<if test="beginDate != null">begin_date = #{beginDate},</if>
<if test="endDate != null">end_date = #{endDate},</if>
<if test="objectId != null">object_id = #{objectId},</if>
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="planCode != null">plan_code = #{planCode},</if>
<if test="isErp != null">is_erp = #{isErp},</if>
<if test="prodNumber != null">prod_number = #{prodNumber},</if>
</trim>
where obj_id = #{objId}
</update>
@ -154,4 +179,25 @@
#{objId}
</foreach>
</delete>
<select id="salarySummaryReport" resultType="ReportSalarySummary">
select bsi.staff_id staffId,
bsi.staff_name staffName,
rss.id_card idCard,
bsi.team_code groupId,
sum(rss.revenue_amount) revenueAmount
from record_staff_salary rss
left join base_staff_info bsi on rss.id_card = bsi.pass_word
where rss.is_erp = 1
<if test="beginEventDate != null and beginEventDate != '' and endEventDate != null and endEventDate != ''">
and FORMAT(rss.event_date, 'yyyy-MM-dd') between #{beginEventDate} and #{endEventDate}
</if>
<if test="staffName != null and staffName != ''">
and bsi.staff_name like concat('%', #{staffName}, '%')
</if>
<if test="groupId != null and groupId != ''">
and bsi.team_code like concat('%', #{groupId}, '%')
</if>
group by bsi.staff_id, bsi.staff_name, rss.id_card, bsi.team_code
</select>
</mapper>

@ -49,13 +49,14 @@ public class ERPTask {
portService.getERPEmployeeWageData(paramDto);
}
public void ERPProductionPlanTask() {
public void ERPProductionPlanTask(Long startDays, Long endDays) {
//获取生产计划管理
String startDate = convertDaysToDateString(startDays, 0);
String endDate = convertDaysToDateString(endDays, 1);
ERPParamDto paramDto = new ERPParamDto();
paramDto.setAppCode(ERPConstants.salaryAppCode);
paramDto.setController(ERPConstants.salaryController);
paramDto.setActionName(ERPConstants.salaryActionName);
portService.getERPEmployeeWageData(paramDto);
paramDto.setPlanStartTime(startDate);
paramDto.setPlanEndTime(endDate);
portService.getProductionPlanTask(paramDto);
}
/**

Loading…
Cancel
Save