Merge remote-tracking branch 'origin/master'

master
mengjiao 6 months ago
commit af48888348

@ -84,6 +84,26 @@ public class MesPrepareDetailDTO extends BaseEntity {
private String recoil;
private String buyFlag;
private String parentWorkOrder;
//以输入单位计的数量
private String erfmg;
//条目单位
private String erfme;
public String getErfmg() {
return erfmg;
}
public void setErfmg(String erfmg) {
this.erfmg = erfmg;
}
public String getErfme() {
return erfme;
}
public void setErfme(String erfme) {
this.erfme = erfme;
}
public String getParentWorkOrder() {
return parentWorkOrder;

@ -29,6 +29,26 @@ public class SapMaterialPreparation {
private String RGEKZ;
//直接采购标识
private String DBSKZ;
//以输入单位计的数量
private String ERFMG;
//条目单位
private String ERFME;
public String getERFMG() {
return ERFMG;
}
public void setERFMG(String ERFMG) {
this.ERFMG = ERFMG;
}
public String getERFME() {
return ERFME;
}
public void setERFME(String ERFME) {
this.ERFME = ERFME;
}
public String getAUFNR() {
return AUFNR;

@ -475,13 +475,13 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
*
* @param factoryCode
* @param lineCode 线
* @param productDate
* @param productDate
* @param version
* @param productStatus A
* @param content (0)
* @return
*/
public static final List<String> batchAutoCreate(String factoryCode, String lineCode, Date productDate,String version, String content,int batchNum){
public static final List<String> batchAutoCreate(String factoryCode, String lineCode, Date productDate,String version, String content,int batchNum,char startZM){
SimpleDateFormat targetFormat = new SimpleDateFormat("yyyyMMdd");
// Create a Calendar instance and set it to the current date
Calendar calendar = Calendar.getInstance();
@ -495,7 +495,8 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
// Format the new date
String toValidity = targetFormat.format(futureDate);
List<String> batchList=new ArrayList<>();
for (char letter = 'A'; letter < 'A' + batchNum; letter++) {
for (char letter = startZM; letter < startZM + batchNum; letter++) {
String BatchCode=toValidity+Constants.LJ+targetFormat.format(productDate)+lineCode+factoryCode+letter+Constants.OUTPUT_STATUS_A+content+version;
batchList.add(BatchCode);
}

@ -162,13 +162,13 @@ public class HttpUtils {
conn.setRequestProperty("user-agent" , "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
conn.setRequestProperty("Accept-Charset" , "utf-8");
// conn.setRequestProperty("contentType" , "utf-8");
conn.setRequestProperty("content-Type", "application/json; charset=utf-8");
conn.setRequestProperty("content-Type", "application/json; charset=GBK");
conn.setDoOutput(true);
conn.setDoInput(true);
out = new PrintWriter(conn.getOutputStream());
out.print(param);
out.flush();
in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "GBK"));
String line;
while ((line = in.readLine()) != null) {
result.append(line);

@ -39,7 +39,7 @@ public class EquOrderController extends BaseController {
*/
@RequiresPermissions("device:deviceOrder:list")
@GetMapping("/list")
@Log(title = "保养记录", businessType = BusinessType.QUERY)
@Log(title = "查询工单", businessType = BusinessType.QUERY)
public TableDataInfo list(EquOrder equOrder) {
startPage();
List<EquOrder> list = equOrderService.selectEquOrderList(equOrder);
@ -50,7 +50,7 @@ public class EquOrderController extends BaseController {
*
*/
@RequiresPermissions("device:deviceOrder:export")
@Log(title = "点检记录", businessType = BusinessType.EXPORT)
@Log(title = "计划工单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EquOrder equOrder) {
List<EquOrder> list = equOrderService.selectEquOrderList(equOrder);

@ -187,4 +187,7 @@ public interface EquOrderMapper {
* @param equ
*/
void updateEquipmentStatus(Equipment equ);
//获取组线信息
String getGroupLine(String auxiliaryEquipmentCode);
}

@ -396,6 +396,78 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
String key = "#header.poolName";
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_", ""));
equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
//微信提醒
//PDA企业微信报修审核提醒
//发企业微信--------------------开始(跟班组有关)
SimpleDateFormat myFmt=new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒"); //规范时间格式
SysNoticeGroup noticeQo = new SysNoticeGroup();
noticeQo.setNoticeId(10L);
List<SysNoticeGroup> notices = equRepairOrderMapper.getNoticesGroup(noticeQo);
if(!CollectionUtils.isEmpty(notices)) {
List<WechartDTO> wecharts = new ArrayList<>();
List<String> userCodes = notices.stream()
.map(SysNoticeGroup::getUserCode)
.collect(Collectors.toList());
for (SysNoticeGroup noticeDto : notices) {
WechartDTO wechart0 = new WechartDTO();
wechart0.setUserId(noticeDto.getWxId());
String contentInfo = noticeDto.getNoticeContent();
//在前端填的时候,需要判空!!!!!!
contentInfo = contentInfo
.replace("${message}", "\n")
.replace("${equipmentCode}", equOrder.getEquipmentCode()+"\n")
.replace("${orderCode}", equOrder.getOrderCode()+"\n")
.replace("${orderDesc}", equRepairOrder.getOrderSource() + "存在不达标检查项"+"\n")
;
//故障开始时间
if(equOrder.getOrderStart() != null){
contentInfo = contentInfo.replace("${orderBreakdownTime}", myFmt.format(equOrder.getOrderStart())+"\n");
}else{
contentInfo = contentInfo.replace("${orderBreakdownTime}", "无"+"\n");
}
//报修人equOrder
if(equOrder.getPlanPersonName() != null){
contentInfo = contentInfo.replace("${orderRepairmanName}", equOrder.getPlanPersonName()+"\n");
}else{
contentInfo = contentInfo.replace("${orderRepairmanName}", "无"+"\n");
}
//查询设备相关信息
//设备名称
EquEquipment equ = equEquipmentMapper.selectEquEquipmentByEquEquipmentCode(equOrder.getEquipmentCode());
if(StringUtils.isNotEmpty(equ.getEquipmentName())){
contentInfo = contentInfo.replace("${equipmentName}", equ.getEquipmentName()+"\n");
}else{
contentInfo = contentInfo.replace("${equipmentName}", "无"+"\n");
}
//设备位置
if(StringUtils.isNotEmpty(equ.getEquipmentLocation())){
contentInfo = contentInfo.replace("${equipmentLocation}", equ.getEquipmentLocation()+"\n");
}else{
contentInfo = contentInfo.replace("${equipmentLocation}", "无"+"\n");
}
Pattern p= Pattern.compile("<[^>]+>");
Matcher m = p.matcher(contentInfo);
contentInfo = m.replaceAll("");
System.out.println(contentInfo);
wechart0.setText(contentInfo);
wecharts.add(wechart0);
}
logger.info("PDA端"+ equRepairOrder.getOrderSource() + "报修企业微信提醒请求:" + JSONObject.toJSONString(wecharts));
if (!CollectionUtils.isEmpty(wecharts)) {
new Thread(() -> {
AjaxResult wxresult = remoteOpenService.sendWeChartMessage(wecharts);
logger.info("PDA端报修企业微信提醒结果" + JSONObject.toJSONString(wxresult));
}).start();
}
//发企业微信--------------------结束
}
}
// 如果不存在未达标信息

@ -5,6 +5,7 @@ import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
@ -339,6 +340,13 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
if ("1".equals(plan.getUpkeep())) {//1委外工单
order.setOutsourceCode("BW" + orderCode);
}
if(StringUtils.isNotEmpty(plan.getEquipmentCode())){
//查询组线
String lineName = equOrderMapper.getGroupLine(plan.getEquipmentCode());
order.setPlanProdLine(lineName);
}
/**equ_order**/
sce = equOrderMapper.insertEquOrder(order);
System.out.println(plan.getPlanCode() + "========equ_order:" + sce);

@ -47,7 +47,6 @@
<result property="itemType" column="item_type"/>
<result property="itemTypeName" column="item_type_name"/>
<result property="itemTools" column="item_tools"/>
<result property="outsourceCode" column="outsource_code"/>
<result property="equipmentName" column="equipment_name"/>
</resultMap>
@ -110,7 +109,7 @@
<if test="planType != null and planType != ''">and eo.plan_type = #{planType}</if>
<if test="orderCode != null and orderCode != ''">and eo.order_code like concat('%', #{orderCode}, '%')</if>
<if test="planWorkshop != null and planWorkshop != ''">and eo.plan_workshop = #{planWorkshop}</if>
<if test="planProdLine != null and planProdLine != ''">and eo.plan_prod_line = #{planProdLine}</if>
<if test="planProdLine != null and planProdLine != ''">and eo.plan_prod_line like concat('%', #{planProdLine}, '%')</if>
<if test="planLoop != null and planLoop != ''">and eo.plan_loop = #{planLoop}</if>
<if test="planLoopType != null and planLoopType != ''">and eo.plan_loop_type = #{planLoopType}</if>
<if test="equipmentCode != null and equipmentCode != ''">and eo.equipment_code like concat('%',#{equipmentCode}, '%')</if>
@ -517,5 +516,12 @@
and del_flag = '0'
</update>
<!-- 获取组线信息 -->
<select id="getGroupLine" parameterType="java.lang.String" resultType="java.lang.String">
select TOP 1 equipment_name
from equ_bind_auxiliary_equipment
where auxiliary_equipment_code = #{auxiliaryEquipmentCode}
and del_flag = '0'
</select>
</mapper>

@ -95,7 +95,7 @@ public class BaseLineMonitorServiceImpl implements IBaseLineMonitorService {
if (lineMonitor.getObjid().equals(lineMonitor.getParentId())) {
continue;
}
Long grade = 0L;
Long grade = 1L;
grade = updateLineMonitorGrade(baseLineMonitors, lineMonitor, objIdList, grade);
if (StringUtils.isNull(lineMonitor.getGrade()) || !lineMonitor.getGrade().equals(grade)) {
lineMonitor.setGrade(grade);
@ -111,7 +111,6 @@ public class BaseLineMonitorServiceImpl implements IBaseLineMonitorService {
/**
* 线
*
* @param baseLineMonitors
* @param lineMonitor
* @param objIdList
@ -294,7 +293,6 @@ public class BaseLineMonitorServiceImpl implements IBaseLineMonitorService {
/**
* monitorId
*
* @param monitors
* @param monitorId
* @return

@ -609,6 +609,41 @@ public class ExportExcelUtil<T> {
return result;
}
/**
* List
*
* @param countList
* @return
*/
public static List<int[]> findConsecutiveIndices(List<String> countList, List<String> monitorIdList) {
List<int[]> result = new ArrayList<>();
if (monitorIdList == null || monitorIdList.isEmpty()) {
return result;
}
int start = 0;
int end = 0;
for (int i = 1; i < monitorIdList.size(); i++) {
if (monitorIdList.get(i).equals(monitorIdList.get(i - 1))) {
end = i;
} else {
if (start != end) {
result.add(new int[]{start, end});
}
start = i;
end = i;
}
}
if (start != end) {
result.add(new int[]{start, end});
}
return result;
}
/**
*
*

@ -187,7 +187,8 @@ public class dataAnalysisController extends BaseController {
@PostMapping("/classificationExport")
@ResponseBody
public void classificationExport(HttpServletResponse response, @RequestParam(required = false) Map paramMap) {
public void classificationExport(HttpServletResponse response, @RequestParam(required = false) Map paramMap)
{
List<ExportReport> list = dataAnalysisService.classificationExportReport(paramMap);
List<ExportReport> originalList = SpringUtils.deepCopy(list);
@ -198,12 +199,18 @@ public class dataAnalysisController extends BaseController {
ArrayList<String> threeList = new ArrayList<>();
ArrayList<String> fourList = new ArrayList<>();
ArrayList<String> fiveList = new ArrayList<>();
ArrayList<String> threeMList = new ArrayList<>();
ArrayList<String> fourMList = new ArrayList<>();
ArrayList<String> fiveMList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
oneList.add(list.get(i).getOneExpend() == null ? "" : list.get(i).getOneExpend().toPlainString());
twoList.add(list.get(i).getTwoExpend() == null ? "" : list.get(i).getTwoExpend().toPlainString());
threeList.add(list.get(i).getThreeExpend() == null ? "" : list.get(i).getThreeExpend().toPlainString());
fourList.add(list.get(i).getFourExpend() == null ? "" : list.get(i).getFourExpend().toPlainString());
fiveList.add(list.get(i).getFiveExpend() == null ? "" : list.get(i).getFiveExpend().toPlainString());
threeMList.add(list.get(i).getThreeMonitorId() == null ? "" : list.get(i).getThreeMonitorId());
fourMList.add(list.get(i).getFourMonitorId() == null ? "" : list.get(i).getFourMonitorId());
fiveMList.add(list.get(i).getFiveMonitorId() == null ? "" : list.get(i).getFiveMonitorId());
}
List<int[]> oneListIndices = findConsecutiveIndices(oneList);
for (int[] consecutiveIndex : oneListIndices) {
@ -217,24 +224,27 @@ public class dataAnalysisController extends BaseController {
list.get(i).setTwoExpend(null);
}
}
List<int[]> threeListIndices = findConsecutiveIndices(threeList);
List<int[]> threeListIndices = findConsecutiveIndices(threeList, threeMList);
for (int[] consecutiveIndex : threeListIndices) {
if(consecutiveIndex[1] - consecutiveIndex[0] < 1){
continue;
}
for (int i = consecutiveIndex[0] + 1; i < consecutiveIndex[1] + 1; i++) {
list.get(i).setThreeExpend(null);
}
}
List<int[]> fourListIndices = findConsecutiveIndices(fourList);
List<int[]> fourListIndices = findConsecutiveIndices(fourList, fourMList);
for (int[] consecutiveIndex : fourListIndices) {
if (consecutiveIndex[1] - consecutiveIndex[0] < 2) {
if(consecutiveIndex[1] - consecutiveIndex[0] < 1){
continue;
}
for (int i = consecutiveIndex[0] + 1; i < consecutiveIndex[1] + 1; i++) {
list.get(i).setFourExpend(null);
}
}
List<int[]> fiveListIndices = findConsecutiveIndices(fiveList);
List<int[]> fiveListIndices = findConsecutiveIndices(fiveList, fiveMList);
for (int[] consecutiveIndex : fiveListIndices) {
if (consecutiveIndex[1] - consecutiveIndex[0] < 2) {
if(consecutiveIndex[1] - consecutiveIndex[0] < 1){
continue;
}
for (int i = consecutiveIndex[0] + 1; i < consecutiveIndex[1] + 1; i++) {

@ -320,7 +320,6 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
baseLineLoss.setParams(params);
List<BaseLineLoss> baseLineLosses = baseLineLossMapper.selectBaseLineLossList(baseLineLoss);
try {
List<BaseLineMonitor> lineMonitorList = baseLineMonitorMapper.selectBaseLineMonitorList(new BaseLineMonitor());
for (BaseLineLoss lineLoss : baseLineLosses) {
HashMap<String, String> hashMap = new HashMap<>();
List<Map<String, String>> energyConsumptionList = new ArrayList<>();

@ -32,43 +32,93 @@
</resultMap>
<sql id="selectBaseLineMonitorVo">
select objid, parent_id, monitor_id, monitor_name, monitor_addr, monitor_type, monitor_status, collect_device_id, build_id, ancestors, grade, correct_value, is_ammeter, line_name, line_length, line_status, power_capacity, water_capacity, dept_id, user_id, create_by, create_time, update_by, update_time from base_line_monitor
select blm.objid,
blm.parent_id,
blm.monitor_id,
bmi.monitor_name,
bmi.monitor_addr,
blm.monitor_type,
blm.monitor_status,
blm.collect_device_id,
blm.build_id,
blm.ancestors,
blm.grade,
blm.correct_value,
blm.is_ammeter,
blm.line_name,
blm.line_length,
blm.line_status,
blm.power_capacity,
blm.water_capacity,
blm.dept_id,
blm.user_id,
blm.create_by,
blm.create_time,
blm.update_by,
blm.update_time
from base_line_monitor blm
left join base_monitor_info bmi on blm.monitor_id = bmi.monitor_id
</sql>
<select id="selectBaseLineMonitorList" parameterType="BaseLineMonitor" resultMap="BaseLineMonitorResult">
<include refid="selectBaseLineMonitorVo"/>
<where>
<if test="parentId != null ">and parent_id = #{parentId}</if>
<if test="monitorName != null and monitorName != ''">and monitor_name like concat('%', #{monitorName},
<if test="parentId != null ">and blm.parent_id = #{parentId}</if>
<if test="monitorName != null and monitorName != ''">and blm.monitor_name like concat('%', #{monitorName},
'%')
</if>
<if test="monitorAddr != null and monitorAddr != ''">and monitor_addr = #{monitorAddr}</if>
<if test="monitorType != null ">and monitor_type = #{monitorType}</if>
<if test="monitorStatus != null ">and monitor_status = #{monitorStatus}</if>
<if test="collectDeviceId != null and collectDeviceId != ''">and collect_device_id = #{collectDeviceId}
<if test="monitorAddr != null and monitorAddr != ''">and blm.monitor_addr = #{monitorAddr}</if>
<if test="monitorType != null ">and blm.monitor_type = #{monitorType}</if>
<if test="monitorStatus != null ">and blm.monitor_status = #{monitorStatus}</if>
<if test="collectDeviceId != null and collectDeviceId != ''">and blm.collect_device_id = #{collectDeviceId}
</if>
<if test="buildId != null and buildId != ''">and build_id = #{buildId}</if>
<if test="ancestors != null and ancestors != ''">and ancestors = #{ancestors}</if>
<if test="grade != null ">and grade = #{grade}</if>
<if test="correctValue != null ">and correct_value = #{correctValue}</if>
<if test="isAmmeter != null and isAmmeter != ''">and is_ammeter = #{isAmmeter}</if>
<if test="lineName != null and lineName != ''">and line_name like concat('%', #{lineName}, '%')</if>
<if test="lineLength != null ">and line_length = #{lineLength}</if>
<if test="lineStatus != null ">and line_status = #{lineStatus}</if>
<if test="powerCapacity != null ">and power_capacity = #{powerCapacity}</if>
<if test="waterCapacity != null ">and water_capacity = #{waterCapacity}</if>
<if test="deptId != null ">and dept_id = #{deptId}</if>
<if test="userId != null ">and user_id = #{userId}</if>
<if test="buildId != null and buildId != ''">and blm.build_id = #{buildId}</if>
<if test="ancestors != null and ancestors != ''">and blm.ancestors = #{ancestors}</if>
<if test="grade != null ">and blm.grade = #{grade}</if>
<if test="correctValue != null ">and blm.correct_value = #{correctValue}</if>
<if test="isAmmeter != null and isAmmeter != ''">and blm.is_ammeter = #{isAmmeter}</if>
<if test="lineName != null and lineName != ''">and blm.line_name like concat('%', #{lineName}, '%')</if>
<if test="lineLength != null ">and blm.line_length = #{lineLength}</if>
<if test="lineStatus != null ">and blm.line_status = #{lineStatus}</if>
<if test="powerCapacity != null ">and blm.power_capacity = #{powerCapacity}</if>
<if test="waterCapacity != null ">and blm.water_capacity = #{waterCapacity}</if>
<if test="deptId != null ">and blm.dept_id = #{deptId}</if>
<if test="userId != null ">and blm.user_id = #{userId}</if>
</where>
</select>
<select id="selectBaseLineMonitorByObjid" parameterType="Long" resultMap="BaseLineMonitorResult">
<include refid="selectBaseLineMonitorVo"/>
where objid = #{objid}
where blm.objid = #{objid}
</select>
<select id="selectBaseLineMonitorByMonitorId" resultMap="BaseLineMonitorResult">
select t.objid, t.parent_id, t.monitor_id, t.monitor_name, t.monitor_addr, t.monitor_type, t.monitor_status, t.collect_device_id, t.build_id, t.ancestors, t.grade, t.correct_value, t.is_ammeter, t.line_name, t.line_length, t.line_status, t.power_capacity, t.water_capacity, t.dept_id, t.user_id, t.create_by, t.create_time, t.update_by, t.update_time
select t.objid,
t.parent_id,
t.monitor_id,
t.monitor_name,
t.monitor_addr,
t.monitor_type,
t.monitor_status,
t.collect_device_id,
t.build_id,
t.ancestors,
t.grade,
t.correct_value,
t.is_ammeter,
t.line_name,
t.line_length,
t.line_status,
t.power_capacity,
t.water_capacity,
t.dept_id,
t.user_id,
t.create_by,
t.create_time,
t.update_by,
t.update_time
from base_line_monitor t
left join (select parent_id, count(*) sum from base_line_monitor group by parent_id) tp
on tp.parent_id = t.objid
where t.monitor_id = #{monitor_id}
</select>
<insert id="insertBaseLineMonitor" parameterType="BaseLineMonitor" useGeneratedKeys="true" keyProperty="objid">

@ -88,13 +88,13 @@
(SELECT t.monitor_id FROM base_monitor_info t WHERE dbo.FIND_IN_SET(#{monitorSubset}, ancestors) > 0))
</if>
<if test="params.beginBeginTime != null and params.beginBeginTime != '' and params.endBeginTime != null and params.endBeginTime != ''">
and begin_time between #{params.beginBeginTime} and #{params.endBeginTime}
and CONVERT(VARCHAR(17), begin_time, 120) between #{params.beginBeginTime} and #{params.endBeginTime}
</if>
<if test="params.startTime != null and params.startTime != '' and params.endTime != null and params.endTime != ''">
and begin_time between #{params.startTime} and #{params.endTime}
and CONVERT(VARCHAR(17), begin_time, 120) between #{params.startTime} and #{params.endTime}
</if>
<if test="params.beginCollectTime != null and params.beginCollectTime != '' and params.endCollectTime != null and params.endCollectTime != ''">
and begin_time between #{params.beginCollectTime} and #{params.endCollectTime}
and CONVERT(VARCHAR(17), begin_time, 120) between #{params.beginCollectTime} and #{params.endCollectTime}
</if>
<if test="endTime != null ">and end_time = #{endTime}</if>
<if test="recordTime != null ">and record_time = #{recordTime}</if>
@ -220,9 +220,8 @@
rpd.monitor_id monitorId,
m.monitor_name monitorName,
m.monitor_addr address,
sum(isnull(ert.expend,0)) expend,
sum(isnull(rpd.expend,0)) expend,
max(rpd.meter_value) meterValue,
GROUP_CONCAT(DISTINCT bpu.user_name SEPARATOR ',') owningUser,
concat(#{beginCollectTime},' 至 ',#{endCollectTime}) timeRange,
m.monitor_hierarchy monitorHierarchy,
m.grade
@ -243,7 +242,7 @@
left join base_public_user bpu on bmp.public_share_id = bpu.id
<where>
<if test="beginCollectTime != null and beginCollectTime != '' and endCollectTime != null and endCollectTime != ''">
and left(CONVERT(VARCHAR(17), rpd.begin_time, 120)e,10) between #{beginCollectTime} and #{endCollectTime}
and left(CONVERT(VARCHAR(17), rpd.begin_time, 120),10) between #{beginCollectTime} and #{endCollectTime}
</if>
<if test="monitorIdList != null and monitorIdList.size > 0">
and rpd.monitor_id IN

@ -114,6 +114,24 @@ public class MesReportWorkConsume extends BaseEntity {
private String planQuantity;
private String machineCode;
private String rspos;//sap物料项目编号
private String erfmg;
private String erfme;
public String getErfmg() {
return erfmg;
}
public void setErfmg(String erfmg) {
this.erfmg = erfmg;
}
public String getErfme() {
return erfme;
}
public void setErfme(String erfme) {
this.erfme = erfme;
}
public String getRspos() {
return rspos;

@ -72,7 +72,7 @@ public interface MesLineMapper {
MesLine selectInfoByLineProduct(MesLine mesLine);
void insertLineProduct(MesLine mesLine);
int insertLineProduct(MesLine mesLine);
void updateLineProduct(MesLine mesLine);
}

@ -1,6 +1,7 @@
package com.op.mes.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@ -14,6 +15,7 @@ import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.mes.domain.MesLineProcess;
import com.op.mes.domain.MesLineProduct;
import com.op.mes.mapper.MesLineProductMapper;
import com.op.mes.service.IMesLineProcessService;
import com.op.mes.service.IMesLineProductService;
import org.apache.commons.collections4.CollectionUtils;
@ -43,6 +45,9 @@ public class MesLineServiceImpl implements IMesLineService {
@Autowired
private MesLineMapper mesLineMapper;
@Autowired
private MesLineProductMapper mesLineProductMapper;
@Autowired
private IMesLineProcessService mesLineProcessService;
@Autowired
@ -97,49 +102,20 @@ public class MesLineServiceImpl implements IMesLineService {
*/
@Override
@DS("#header.poolName")
@Transactional(propagation = Propagation.REQUIRED)
// @Transactional(propagation = Propagation.REQUIRED)
public int insertMesLine(MesLine mesLine) {
mesLine.setCreateTime(DateUtils.getNowDate());
mesLine.setCreateBy(SecurityUtils.getUsername());
mesLine.setId(IdUtils.fastSimpleUUID());
String belongTo = mesLine.getId();
// 获取工厂编码
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
String factoryCode = request.getHeader(key.substring(8)).replace("ds_", "");
mesLine.setFactoryCode(factoryCode);
// 绑定工艺
List<String> processList = mesLine.getProcessList();
List<BigDecimal> qualityList = mesLine.getQualityList();
if (!CollectionUtils.isEmpty(processList)) {
String lineCode = mesLine.getLineCode();
String lineName = mesLine.getLineName();
for (int i = 0; i < processList.size(); i++) {
MesLineProcess mesLineProcess = new MesLineProcess();
mesLineProcess.setBelongTo(belongTo);
mesLineProcess.setProcessName(processList.get(i));
mesLineProcess.setQuality(qualityList.get(i));
mesLineProcess.setLineCode(lineCode);
mesLineProcess.setLineName(lineName);
mesLineProcess.setFactoryCode(factoryCode);
mesLineProcessService.insertMesLineProcess(mesLineProcess);
}
}
// 绑定产品
List<MesLineProduct> productList = mesLine.getProductList();
if (CollectionUtils.isNotEmpty(productList)) {
for (MesLineProduct item : productList) {
item.setId(IdUtils.fastSimpleUUID());
item.setBelongTo(belongTo);
item.setFactoryCode(factoryCode);
item.setCreateBy(SecurityUtils.getUsername());
item.setCreateTime(DateUtils.getNowDate());
}
mesLineProductService.batchInsertMesLineProduct(productList);
}
mesLine.setId(IdUtils.fastSimpleUUID());
mesLine.setFactoryCode(factoryCode);
mesLine.setCreateBy(SecurityUtils.getUsername());
mesLine.setCreateTime(DateUtils.getNowDate());
int m = mesLineMapper.insertLineProduct(mesLine);
return mesLineMapper.insertMesLine(mesLine);
return m;
}
/**

@ -204,7 +204,7 @@
select id, line_code, use_man, efficiency
from mes_line_product
where del_flag = '0' and line_code = #{lineCode}
and use_man = #{useMan} and efficiency = #{efficiency}
and product_code = #{productCode}
</select>
<select id="getProductListBom" resultType="com.op.mes.domain.MesLineProduct">

@ -114,7 +114,7 @@
pow.workorder_code_sap workorderCodeSap,
mrwc.attr1,
mrwc.warehouse_code warehouseCode,
mpd.quantity planQuantity,
mpd.quantity planQuantity,mpd.erfmg,mpd.erfme,
mrwc.parent_order parentOrder,mrwc.report_code reportCode,
mrwc.rspos
from mes_report_work_consume mrwc

@ -386,6 +386,7 @@ public class OpenServiceImpl implements OpenService {
return success();
}
/**首检 批次成品**/
@Override
public int insertQcCheckTaskProduce(QcCheckTaskProduceDTO qcCheckTaskProduce) {
DynamicDataSourceContextHolder.push("ds_" + qcCheckTaskProduce.getFactoryCode());

@ -341,8 +341,9 @@ public class ProOrderController extends BaseController {
/**辅助排产**/
@PostMapping("/autoSplitOrder")
public R autoSplitOrder(@RequestBody ProOrder proOrder) {
return proOrderService.autoSplitOrder(proOrder);
public AjaxResult autoSplitOrder(@RequestBody ProOrder proOrder) {
AjaxResult r= proOrderService.autoSplitOrder(proOrder);
return r;
}
/**辅助排产取消**/

@ -8,6 +8,15 @@ public class ProLine {
private String lineName;
private Long efficiency;
private String dh;
private String factoryDh;
public String getFactoryDh() {
return factoryDh;
}
public void setFactoryDh(String factoryDh) {
this.factoryDh = factoryDh;
}
public Long getEfficiency() {
return efficiency;

@ -75,6 +75,24 @@ public class ProOrder extends TreeEntity {
private String routeCode;
private Integer endFlag;
private String belongWorkOrder;
private String shiftId;
private String factoryDh;
public String getFactoryDh() {
return factoryDh;
}
public void setFactoryDh(String factoryDh) {
this.factoryDh = factoryDh;
}
public String getShiftId() {
return shiftId;
}
public void setShiftId(String shiftId) {
this.shiftId = shiftId;
}
public String getBelongWorkOrder() {
return belongWorkOrder;

@ -231,5 +231,7 @@ public interface ProOrderWorkorderMapper {
List<ProOrderWorkorder> selectFirWorkOrderCG(String id);
List<ProOrderWorkorder> selectChildWorkOrderCG(String workorderCode);
List<String> getBatchDict(String batchFlag);
}

@ -148,7 +148,7 @@ public interface IProOrderService {
ProOrder getCanProductLine(ProOrder proOrder);
R autoSplitOrder(ProOrder proOrder);
AjaxResult autoSplitOrder(ProOrder proOrder);
AjaxResult getWorkOrderListCG(String id);

@ -1,6 +1,7 @@
package com.op.plan.service.impl;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
@ -1318,37 +1319,46 @@ public class ProOrderServiceImpl implements IProOrderService {
//所有线体
List<ProOrder> lineList = proOrderMapper.getCanProductLine();
dto.setLineList(lineList);
List<ProOrder> proLines = proOrderMapper.getSelectLineLevel1(proOrder);
BigDecimal todayPro = new BigDecimal(BigInteger.ZERO);//当日设备实际产能
for(ProOrder pLines:proLines){
todayPro = todayPro.add(pLines.getEfficiency());
}
if(todayPro.doubleValue() < proOrder.getQuantity()){
logger.error("当日设备产能达不到订单要求");
return null;
}
//推荐线体
List<String> recommendLineList = getRecommendLines(proOrder);
List<String> recommendLineList = getRecommendLines(proLines,proOrder);
dto.setRecommendLineList(recommendLineList);
return dto;
}
@Override
@DS("#header.poolName")
public R autoSplitOrder(ProOrder proOrder) {
public AjaxResult autoSplitOrder(ProOrder proOrder) {
Date nowTime = DateUtils.getNowDate();//公共时间
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
proOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
proOrder.setCreateTime(nowTime);
String shiftId = proOrder.getShiftId();
//订单总量
proOrder.setQuantitySplit(proOrder.getQuantitySplit()==null?0L:proOrder.getQuantitySplit());
Long orderQua = proOrder.getQuantity()-proOrder.getQuantitySplit();
//有几个设备就有几个工单
for(int i=0;i<proOrder.getLineCodes().length;i++){
if(orderQua == 0L){
logger.info("线体产能满足生产");
break;
}
List<ProOrderWorkorder> workorders = new ArrayList<>();
proOrder.setLineCode(proOrder.getLineCodes()[i]);
ProLine plineInfo = proOrderWorkorderMapper.getLineProductInfo(proOrder);//线体母单产品产能和线体代码
if(plineInfo==null){
logger.error("线体"+proOrder.getLineCodes()[i]+"无法生产");
return R.fail("线体"+proOrder.getLineCodes()[i]+"无法生产");
logger.error("线体"+proOrder.getLineCodes()[i]+"无法生产,请到【线体产品管理界面进行维护】");
return AjaxResult.error(642,"线体"+proOrder.getLineCodes()[i]+"无法生产,请到【线体产品管理界面进行维护】");
}
Long efficiency = plineInfo.getEfficiency();
if(efficiency < orderQua){
@ -1365,6 +1375,7 @@ public class ProOrderServiceImpl implements IProOrderService {
proOrder.setBelongWorkOrder(belongWorkOrder);
proOrder.setWorkerOrder(belongWorkOrder);
proOrder.setParentOrder("0");
proOrder.setShiftId(shiftId);
ProOrderWorkorder pworkOrder = getWorkOrderByOrder(proOrder,proOrder);//TODO;
//父级
workorders.add(pworkOrder);
@ -1384,6 +1395,7 @@ public class ProOrderServiceImpl implements IProOrderService {
sonOrder.setWorkerOrder(sworkOrderCode);
sonOrder.setParentOrder(parentWorkOrder);
sonOrder.setQuantitySplit(sonOrder.getQuantity());
sonOrder.setShiftId(shiftId);
if(CollectionUtils.isEmpty(sonOrder.getChildren())){
sonOrder.setEndFlag(1);
}
@ -1412,7 +1424,21 @@ public class ProOrderServiceImpl implements IProOrderService {
/**拆批次**/
proOrder.setProdSpc(plineInfo.getDh());//借用字段
List<ProOrderWorkorderBatch> workorderBatches0 = getBatchList(proOrder);//TODO;
/**批次中的工厂代码**/
proOrder.setFactoryDh(plineInfo.getFactoryDh());
AjaxResult aResult = getBatchList(proOrder);//Done;
if(!aResult.isSuccess()){
return aResult;
}
List<ProOrderWorkorderBatch> workorderBatches0 = (List<ProOrderWorkorderBatch>)aResult.get("data");
if(CollectionUtils.isEmpty(workorderBatches0)){
logger.error("批次太多,请检查【产品批次数量】、【产线产能】、【批次号夜班开始字母】是否设置正常。");
return AjaxResult.error(642,"批次太多,请检查产品批次数量是否设置正常。");
}
List<ProOrderWorkorderBatch> workBatchs = new ArrayList<>();
for(int m=0;m<workorders.size();m++){
ProOrderWorkorder work = workorders.get(m);
@ -1440,18 +1466,12 @@ public class ProOrderServiceImpl implements IProOrderService {
/**pro_order_workorder_batch**/
if(!CollectionUtils.isEmpty(workBatchs)) {
if(workBatchs.size()>100){
logger.error("批次太多,请检查产品批次数量是否设置正常。");
return R.fail("批次太多,请检查产品批次数量是否设置正常。");
}
int pn = proOrderWorkorderBatchMapper.insertWorkorderBatchs(workBatchs);
System.out.println("pn:"+pn);
}
}
return R.ok();
return AjaxResult.success();
}
/**
@ -1476,12 +1496,16 @@ public class ProOrderServiceImpl implements IProOrderService {
String[][] lineCodeArray = {{gxCode,pOrder.getLineCode()}};
workOrder.setProdLineCode(JSONArray.toJSONString(lineCodeArray));
workOrder.setProductDate(DateUtils.dateTime("yyyy-MM-dd",pOrder.getProductDate()));
//workOrder.setShiftId();
workOrder.setShiftId(pOrder.getShiftId());
workOrder.setParentOrder(proOrder.getParentOrder());
workOrder.setStatus("w0");
workOrder.setCreateBy(SecurityUtils.getUsername());
workOrder.setCreateTime(pOrder.getCreateTime());
workOrder.setProdType(proOrder.getOrderType());
if("LJ88".equals(pOrder.getOrderType())){
workOrder.setProdType("LJ01");
}else{
workOrder.setProdType(pOrder.getOrderType());
}
workOrder.setFactoryCode(pOrder.getFactoryCode());
workOrder.setEndFlag(proOrder.getEndFlag());
workOrder.setSortNo(pOrder.getSortNo());
@ -1489,10 +1513,16 @@ public class ProOrderServiceImpl implements IProOrderService {
}
//靠母单先生成批次模板
protected List<ProOrderWorkorderBatch> getBatchList(ProOrder proOrder){
protected AjaxResult getBatchList(ProOrder proOrder){
List<ProOrderWorkorderBatch> workorderBatches = new ArrayList<>();
Long pworkOrderQua = proOrder.getQuantitySplit();//母工单数量
BaseProduct batchQua0 = proOrderWorkorderMapper.getProductInfo(proOrder);//母单标准批次产能和几合一
if(batchQua0 == null || batchQua0.getBatchQuaStandar()==null){
logger.error("未设置最大批次数,请到【产品管理】界面进行产品的最大批次设置");
return AjaxResult.error("未设置最大批次数,请到【产品管理】界面进行产品的最大批次设置");
}
ProOrderWorkorderBatch workBatch = null;
while(pworkOrderQua>0){
workBatch = new ProOrderWorkorderBatch();
@ -1507,18 +1537,38 @@ public class ProOrderServiceImpl implements IProOrderService {
pworkOrderQua = pworkOrderQua - batchQua0.getBatchQuaStandar().longValue();
}
List<String> batches = proOrderWorkorderMapper.getBatchDict("batch_flag");
char dayWorkBatchStart = batches.get(0).charAt(0);
char nightWorkBatchStart = batches.get(1).charAt(0);
int maxBatchNum = 0;
char startZM = 'A';
if("5".equals(proOrder.getShiftId())){//白班
maxBatchNum = nightWorkBatchStart - dayWorkBatchStart;
startZM = dayWorkBatchStart;
}else if("2".equals(proOrder.getShiftId())){//夜班
maxBatchNum = 'Z' - nightWorkBatchStart;
startZM = nightWorkBatchStart;
}
if(workorderBatches.size()>maxBatchNum){
logger.error("大于工厂字典【batch_flag】推理的的批次数");
return AjaxResult.error("大于工厂字典【batch_flag】推理的的批次数");
}
//获取批次号集合
List<String> batchCodes = StringUtils.batchAutoCreate(proOrder.getFactoryCode(),
List<String> batchCodes = StringUtils.batchAutoCreate(proOrder.getFactoryDh(),
proOrder.getProdSpc(),
DateUtils.dateTime("yyyy-MM-dd",proOrder.getProductDate()),
proOrder.getAtrr2().substring(proOrder.getAtrr2().length()-1),
"0",workorderBatches.size());
"0",workorderBatches.size(),startZM);
for(int n=0;n<workorderBatches.size();n++){
workorderBatches.get(n).setBatchCode(batchCodes.get(n));
}
return workorderBatches;
return AjaxResult.success(workorderBatches);
}
/**
@ -1527,9 +1577,8 @@ public class ProOrderServiceImpl implements IProOrderService {
* 2线
* @param proOrder
*/
protected List<String> getRecommendLines(ProOrder proOrder){
protected List<String> getRecommendLines(List<ProOrder> proLines,ProOrder proOrder){
List<String> lines = new ArrayList<>();
List<ProOrder> proLines = proOrderMapper.getSelectLineLevel1(proOrder);
//订单总量
proOrder.setQuantitySplit(proOrder.getQuantitySplit()==null?0L:proOrder.getQuantitySplit());
BigDecimal orderQuality = new BigDecimal(proOrder.getQuantity()).subtract(new BigDecimal(proOrder.getQuantitySplit()));
@ -1547,18 +1596,7 @@ public class ProOrderServiceImpl implements IProOrderService {
public static void main(String args[]){
// String arrayStr = "[[\"GX01\",\"LG1\"],[\"GX01\",\"LG2\"],[\"GX02\",\"S1\"],[\"GX02\",\"S2\"],[\"GX03\",\"HF01\"],[\"GX04\",\"SPJ01\"]]";
// JSONArray jsonArray = JSONArray.parseArray(arrayStr);
// for(int c=0;c<jsonArray.size();c++){
// System.out.println(jsonArray.getJSONArray(c).getString(1));
// }
// BigDecimal a = new BigDecimal("100");
// BigDecimal b = new BigDecimal("100");
// System.out.println(a.compareTo(b));
int m=1;
while(m<3){
++m;
}
System.out.println(m);
char zm = 'D';
System.out.println(zm-'A'+1);
}
}

@ -488,11 +488,14 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
detail.setCreateBy(SecurityUtils.getUsername());
detail.setCreateTime(createDate);
detail.setParentWorkOrder(workOrders.get(0));
detail.setErfmg(sap.getERFMG());//以输入单位计的数量
detail.setErfme(sap.getERFME());//条目单位
details.add(detail);
logger.info("领料单内容detail" + sap.getRSPOS() + "," + sap.getMATNR() + "," +
sap.getMAKTX() + "," + sap.getWERKS() + "," + sap.getLGORT() + "," +
sap.getBDTER() + "," + sap.getBDMNG() + "," + sap.getZQLSL() + "," +
sap.getMEINS() + "," + sap.getRGEKZ() + "," + sap.getDBSKZ()
sap.getMEINS() + "," + sap.getRGEKZ() + "," + sap.getDBSKZ()+ "," +
sap.getERFMG() + "," + sap.getERFME()
);
}
if (!CollectionUtils.isEmpty(details)) {

@ -225,7 +225,7 @@
GROUP BY line_code
)pt on mlp.line_code = pt.line_code
where mlp.del_flag = '0' and product_code = #{prodCode}
order by mlp.use_man desc,pt.n desc
order by mlp.use_man asc,pt.n desc
</select>

@ -649,9 +649,10 @@
</select>
<select id="getLineProductInfo" resultType="com.op.plan.domain.ProLine">
select mlp.efficiency efficiency,
bp.dh
bp.dh,sf.ancestors factoryDh
from mes_line_product mlp
left join base_equipment bp on mlp.line_code = bp.equipment_code
left join sys_factory sf on sf.factory_code = mlp.factory_code and sf.del_flag = '0'
where mlp.del_flag = '0' and product_code = #{prodCode}
and mlp.line_code = #{lineCode} and bp.del_flag = '0'
</select>
@ -671,6 +672,9 @@
from base_product
where del_flag = '0' and product_code = #{prodCode}
</select>
<select id="getBatchDict" resultType="java.lang.String">
select dict_value from base_dict_data where dict_type = #{batchFlag} order by dict_value
</select>
<insert id="createPrepareDetails">
insert into mes_prepare_detail
@ -760,14 +764,15 @@
INSERT INTO mes_prepare_detail (
record_id,prepare_id,material_code,material_name,unit,
quantity,create_by,create_time,factory_code,status,
locator,need_date,recoil,fund_quanlity,buy_flag,parent_work_order,attr1
locator,need_date,recoil,fund_quanlity,buy_flag,parent_work_order,attr1,
erfmg,erfme
)VALUES
<foreach collection="list" item="d" index="index" separator=",">
(
#{d.recordId},#{d.prepareId},#{d.materialCode},#{d.materailName},#{d.unit},
#{d.quantity},#{d.createBy},#{d.createTime},#{d.factoryCode},#{d.status},
#{d.locator},#{d.needDate},#{d.recoil},#{d.fundQuanlity},#{d.buyFlag},#{d.parentWorkOrder},
#{d.attr1}
#{d.attr1},#{d.erfmg},#{d.erfme}
)
</foreach>
@ -778,7 +783,7 @@
product_name,unit,quantity_split,route_code,prod_line_code,
product_date,parent_order, status,create_by,create_time,
prod_type,factory_code,end_flag,del_flag,sort_no,
belong_work_order
belong_work_order,shift_id
)VALUES
<foreach collection="list" item="d" index="index" separator=",">
(
@ -786,7 +791,7 @@
#{d.productName},#{d.unit},#{d.quantitySplit},#{d.routeCode},#{d.prodLineCode},
#{d.productDate},#{d.parentOrder},#{d.status},#{d.createBy},#{d.createTime},
#{d.prodType}, #{d.factoryCode},#{d.endFlag},'2',#{d.sortNo},
#{d.belongWorkOrder}
#{d.belongWorkOrder},#{d.shiftId}
)
</foreach>
</insert>

@ -214,6 +214,15 @@ public class QcCheckTaskIncome extends BaseEntity {
private String pgzg;//QC主管SFXYZG字段为"是",则此项选择QC主管信息
private String pgzr;//质量主管
private String oaFactoryF;//异常范围
private String sccj;
public String getSccj() {
return sccj;
}
public void setSccj(String sccj) {
this.sccj = sccj;
}
public String getOaFactoryF() {
return oaFactoryF;

@ -132,6 +132,15 @@ public class QcCheckUnqualified extends BaseEntity {
private String pgzg;//QC主管SFXYZG字段为"是",则此项选择QC主管信息
private String pgzr;//质量主管
private String oaFactoryF;
private String sccj;//所属车间
public String getSccj() {
return sccj;
}
public void setSccj(String sccj) {
this.sccj = sccj;
}
public String getOaFactoryF() {
return oaFactoryF;

@ -23,7 +23,7 @@ public interface IQcMaterialGroupService {
public QcMaterialGroup selectQcMaterialGroupById(String id);
/**
*
*
* @param qcMaterialGroup
* @return
*/

@ -140,7 +140,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
/**
*
*
*
* @param qcCheckTaskIncome
* @return
*/
@ -640,7 +640,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
}
@Override
@Transactional(rollbackFor = Exception.class)
//@Transactional(rollbackFor = Exception.class)
public int commitCheckResults(QcCheckTaskIncome qcCheckTaskIncome) {
logger.info("质检提交参数:"+JSONObject.toJSONString(qcCheckTaskIncome));
List<QcCheckTaskDetail> details = qcCheckTaskIncome.getQcCheckTaskDetails();
@ -815,25 +815,28 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
if("produce".equals(qcCheckTaskIncome.getTypeCode())){
unqualified.setTypeCode(qcCheckTaskIncome.getTypeCode());
unqualified.setSfgyswt(qcCheckTaskIncome.getSfgyswt());
unqualified.setUser(qcCheckTaskIncome.getUpdateBy());
//申请人-
unqualified.setSqr(qcCheckTaskIncome.getSqr());
unqualified.setSqr("MSL#"+qcCheckTaskIncome.getSqr());
//申请部门
unqualified.setSqbm(qcCheckTaskIncome.getSqbm());
//所属车间
unqualified.setSccj("MSD#"+qcCheckTaskIncome.getSccj());
//实际生产数量
unqualified.setQuality(qcCheckTaskIncome.getQuality().toString());
//发现地点
unqualified.setCheckLoc(qcCheckTaskIncome.getCheckLoc());
//是否需要主管审核
unqualified.setSfgyswt(qcCheckTaskIncome.getSfgyswt());
unqualified.setSfxyzg(qcCheckTaskIncome.getSfxyzg());
if(qcCheckTaskIncome.getSfgyswt().equals("0")){//是
//qc主管
unqualified.setPgzg(qcCheckTaskIncome.getPgzg());
unqualified.setPgzg("MSL#"+qcCheckTaskIncome.getPgzg());
//质量主管
unqualified.setPgzr(qcCheckTaskIncome.getPgzr());
unqualified.setPgzr("MSL#"+qcCheckTaskIncome.getPgzr());
}
//是否供应商问题
unqualified.setSfgyswt(qcCheckTaskIncome.getSfgyswt());
unqualified.setOaFactoryF(qcCheckTaskIncome.getOaFactoryF());
}else if("material".equals(qcCheckTaskIncome.getTypeCode())){
unqualified.setTypeCode(qcCheckTaskIncome.getTypeCode());
@ -859,19 +862,20 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
//来料数量
unqualified.setQuality(qcCheckTaskIncome.getQuality().toString());
//来料单位
unqualified.setUnit(qcCheckTaskIncome.getUnit());
//CAR:0 PC:1 其它2 吨3 千克4
unqualified.setUnit(getConvertUnit(qcCheckTaskIncome.getUnit()));
//检验编号
unqualified.setCheckNo(qcCheckTaskIncome.getCheckNo());
//仓储报检人-李爱娟
unqualified.setCzbjr(qcCheckTaskIncome.getCzbjr());
unqualified.setCzbjr("MSL#"+qcCheckTaskIncome.getCzbjr());
//物料类别
unqualified.setMaterialType(qcCheckTaskIncome.getMaterialType());
//物料来源
unqualified.setMaterialFrom(qcCheckTaskIncome.getMaterialFrom());
//QC主管-朱继新
unqualified.setQczg(qcCheckTaskIncome.getQczg());
unqualified.setQczg("MSL#"+qcCheckTaskIncome.getQczg());
//申请人-
unqualified.setSqr(qcCheckTaskIncome.getSqr());
unqualified.setSqr("MSL#"+qcCheckTaskIncome.getSqr());
unqualified.setUser(qcCheckTaskIncome.getUpdateBy());
//转出方
unqualified.setZcf(qcCheckTaskIncome.getZcf());
@ -911,6 +915,8 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
.replace("${quality}", qcCheckTaskIncome.getQuality()+"\n");
if(StringUtils.isNotBlank(qcCheckTaskIncome.getIncomeBatchNo())){
contentInfo = contentInfo.replace("${incomeBatchNo}", qcCheckTaskIncome.getIncomeBatchNo()+"\n");
}else{
contentInfo = contentInfo.replace("${incomeBatchNo}", "无"+"\n");
}
if(StringUtils.isNotBlank(qcCheckTaskIncome.getOrderNo())){
contentInfo = contentInfo.replace("${orderNo}", qcCheckTaskIncome.getOrderNo()+"\n");
@ -931,6 +937,15 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
//发企业微信--------------------结束
}
}
//CAR:0 PC:1 其它2 吨3 千克4
protected String getConvertUnit(String unit){
String unitOa= "";
switch (unit) {
case "ST": unitOa="1";
default: unitOa="1";
}
return unitOa;
}
protected String getSampleQua(QcCheckTaskIncome qcCheckTaskIncome){
String sampleQuaStr = "";
@ -993,4 +1008,9 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
public SysUser getOaUserId(SysUser getUserIdList) {
return qcCheckTaskIncomeMapper.getOaUserId(getUserIdList);
}
public static void main(String args[]){
QcCheckTaskIncomeServiceImpl impl = new QcCheckTaskIncomeServiceImpl();
System.out.println(impl.getConvertUnit("ST"));
}
}

@ -145,6 +145,7 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
*
*
* @param qcCheckTaskProduce
*
* @return
*/
@Override

@ -247,7 +247,7 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService
return failOrder;
}
@Transactional(rollbackFor = Exception.class)
//@Transactional(rollbackFor = Exception.class)
public String syncFunc(QcMaterialGroupDetail materialGroupDetail){
String failOrder = "";
Date nowDate = DateUtils.getNowDate();

@ -177,14 +177,13 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
* \"supplier\":\"广东高顺印刷包装有限公司\",\"CHARG\":\"null\",\"comeQty\":\"1117\",
* \"DW\":\"ST\",\"JYBH\":\"202404180042\",\"BJY\":\"202404180042\",\"WLLY\":\"2\",
* \"memo\":\"不合格\",\"PZGLBZG\":\"不合格\"}","user":"999999","requestLevel":0,"workflowId":113454}
*/
private AjaxResult createLLOA(QcCheckUnqualified task){
//QcCheckTaskIncome detailInfo = qcCheckTaskIncomeMapper.getTaskInfo(task.getTaskId());
//发起来料检验OA流程
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("user",task.getSqr());//提交人工号
paramMap.put("user",task.getUser());//提交人工号
paramMap.put("requestLevel",0);//流程紧急度
paramMap.put("requestName","ZL0010-来料检验不合格控制流程");//流程名称
paramMap.put("workflowId",113454);//该流程对应的唯- workFlowld
@ -195,7 +194,7 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
StringBuffer mainObject = new StringBuffer();
mainObject.append("{");
mainObject.append("\"SQR\":"+"\""+task.getSqr()+"");//申请人--
mainObject.append("\"SQR\":"+"\""+task.getSqr()+"\"");//申请人--
mainObject.append(",\"CQ\":"+task.getOaFactory());//厂区--
mainObject.append(",\"LLLB\":"+task.getMaterialType());//来料类别【0、1】
mainObject.append(",\"MATNR\":"+"\""+task.getMaterialCode()+"\"");//物料编码
@ -306,6 +305,29 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
"SFGYSWT":"1" * 1 0
}"
}
http://oa.lanju.cn/lanju/oa/submitOa.jsp?
user=9999999&requestLevel=0&
requestName=&
workflowId=113455&
mainObject={"CPMC":"榄菊加大盘野菊花蚊香塑料筒装(18装)(36单圈)",
"CPBM":"000000010101046600",
"SQBM":"0",
"SQR":"MSL#999999", \"SQR\":\"MSL#002007\",
"SQSJ":"2024-07-18",
"SCCJ":"MSD#10000769", \"SCCJ\":\"MSD#10000152\",
"SCPH":"LJ20240705ABACEQ",
"SCSL":100,
"FXDD":"测试发现地点",
"FXRQ":"2024-07-18 16:26:45",
"BH":"202407040001",
"YCFW":"1",
"PZYCMS":"zxl测试不合格发起oa",
"Notes":"",
"SFXYZG":"0",
"PGZG":"MSL%23001539",
"PGZR":"MSL%23001539",
"SFGYSWT":"0"}
* @param task
* @return
*/
@ -314,31 +336,31 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
QcCheckTaskIncome detailInfo = qcCheckTaskIncomeMapper.getTaskInfo(task.getTaskId());
//发起来料检验OA流程
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("user",task.getSqr());//提交人工号
paramMap.put("user",task.getUser());//提交人工号
paramMap.put("requestLevel",0);//流程紧急度
paramMap.put("requestName","ZL0030-品质异常流程-智能制造-"+DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",detailInfo.getIncomeTime())+"(产品名称:"+detailInfo.getMaterialName()+"");//流程名称
paramMap.put("workflowId",113455);//该流程对应的唯- workFlowld
StringBuffer mainObject = new StringBuffer();
mainObject.append("{");
mainObject.append("\"CPMC\":"+detailInfo.getMaterialName());//产品名称
mainObject.append(",\"CPBM\":"+detailInfo.getMaterialCode());//产品编码
mainObject.append(",\"SQBM\":"+task.getSqbm());//0品质保障部
mainObject.append("\"CPMC\":"+"\""+detailInfo.getMaterialName()+"\"");//产品名称
mainObject.append(",\"CPBM\":"+"\""+detailInfo.getMaterialCode()+"\"");//产品编码
mainObject.append(",\"SQBM\":"+"\""+task.getSqbm()+"\"");//0品质保障部
mainObject.append(",\"SQR\":"+"\""+task.getSqr()+"\"");//申请人:默认当前用户
mainObject.append(",\"SQSJ\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd",detailInfo.getCheckTime())+"\"");//申请时间
mainObject.append(",\"SCCJ\":"+"\"162\"");//所属车间
mainObject.append(",\"SCCJ\":"+"\""+task.getSccj()+"\"");//所属车间
mainObject.append(",\"SCPH\":"+"\""+detailInfo.getIncomeBatchNo()+"\"");//生产批号
mainObject.append(",\"SCSL\":"+"\""+task.getQuality()+"\"");//生产数量
mainObject.append(",\"SCSL\":"+task.getQuality());//生产数量
mainObject.append(",\"FXDD\":"+"\""+task.getCheckLoc()+"\"");//发现地点
mainObject.append(",\"FXRQ\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",detailInfo.getCheckTime())+"\"");//发现日期
mainObject.append(",\"FXRQ\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd",detailInfo.getCheckTime())+"\"");//发现日期
mainObject.append(",\"BH\":"+"\""+detailInfo.getCheckNo()+"\"");//编号:流水号 年月日+四位流水号
mainObject.append(",\"YCFW\":"+task.getOaFactoryF()+"\"");//*异常范围:下拉框榄菊所有工厂 1代表小榄工厂
mainObject.append(",\"YCFW\":"+"\""+task.getOaFactoryF()+"\"");//*异常范围:下拉框榄菊所有工厂 1代表小榄工厂
mainObject.append(",\"PZYCMS\":"+"\""+detailInfo.getRemark()+"\"");//品质异常描述
mainObject.append(",\"Notes\":"+"\"\"");//测试备注
mainObject.append(",\"SFXYZG\":"+"\""+task.getSfxyzg()+"\"");//*是否需要主管审核 1否 0是
mainObject.append(",\"PGZG\":"+"\""+task.getPgzg()+"\"");//QC主管SFXYZG字段为"是",则此项选择QC主管信息
mainObject.append(",\"PGZR\":"+"\""+task.getPgzr()+"\"");//质量主管 660朱继新
mainObject.append(",\"SFGYSWT\":"+task.getSfgyswt()+"\"");//*是否供应商问题 1非供应商问题 0是供应商问题
mainObject.append(",\"SFGYSWT\":"+"\""+task.getSfgyswt()+"\"");//*是否供应商问题 1非供应商问题 0是供应商问题
mainObject.append("}");

@ -1,22 +1,35 @@
package com.op.quality.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.QcCheckTaskIncome;
import com.op.quality.domain.QcCheckUnqualified;
import com.op.quality.domain.vo.TreeSelect;
import com.op.quality.mapper.QcCheckTaskIncomeMapper;
import com.op.system.api.RemoteOpenService;
import com.op.system.api.RemoteQualityService;
import com.op.system.api.domain.SysNoticeGroup;
import com.op.system.api.domain.dto.WechartDTO;
import com.op.system.api.domain.quality.QcCheckTaskIncomeDTO;
import com.sun.xml.bind.v2.TODO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.quality.mapper.QcGoalMapper;
import com.op.quality.domain.QcGoal;
import com.op.quality.service.IQcGoalService;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@ -31,8 +44,24 @@ import javax.servlet.http.HttpServletRequest;
*/
@Service
public class QcGoalServiceImpl implements IQcGoalService {
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private QcGoalMapper qcGoalMapper;
// @Autowired
// private QcCheckTaskIncomeMapper qcCheckTaskIncomeMapper;
// @Autowired
// private RemoteOpenService remoteOpenService;
//
// private static Pattern p2= Pattern.compile("<[^>]+>");
@Autowired
private RemoteOpenService remoteOpenService;
@Autowired
private RemoteQualityService remoteQualityService;
@Autowired
private QcCheckTaskIncomeMapper qcCheckTaskIncomeMapper;
/**
*
@ -59,9 +88,147 @@ public class QcGoalServiceImpl implements IQcGoalService {
for (QcGoal item : qcGoals) {
item.setHasChildren(true);
}
// QcCheckUnqualified task = new QcCheckUnqualified();
// task.setUser("002007");//9999999
// task.setSqr("660");
// task.setOaFactory("0");
// task.setMaterialType("0");
// task.setMaterialCode("000000040000015128");
// task.setMaterialName("榄菊蚊香加大盘Ф137.5mm×H100mm36圈内增高塑料筒(有字盖2201");
// task.setSupplierCode("0000100330");
// task.setSupplierName("中山市荣星塑料包装有限公司");
// task.setQuality("15296");
// task.setUnit("ST");
// task.setCheckNo("202407130047");
// task.setCzbjr("284");
// task.setMaterialFrom("2");
// task.setZcf("0");
// task.setZcoemcm("转出工厂");
// task.setRemark("zxl测试不合格发起oa");
// task.setQczg("660");
// this.createLLOA(task);
// //手持来料质检触发
// QcCheckTaskIncomeDTO qcCheckTaskIncomeDTO = new QcCheckTaskIncomeDTO();
// qcCheckTaskIncomeDTO.setPoolName("ds_1000" );
// qcCheckTaskIncomeDTO.setCheckLoc("mjtest");
// qcCheckTaskIncomeDTO.setCheckType("checkTypeLL");
//// qcCheckTaskIncomeDTO.setCheckManCode("mobile");
//// qcCheckTaskIncomeDTO.setCheckManName("手持测试用户");
// qcCheckTaskIncomeDTO.setSupplierCode("0000102272");
// qcCheckTaskIncomeDTO.setFactoryCode("1000");
// qcCheckTaskIncomeDTO.setSupplierName("广州市彩晴包装印刷有限公司");
// qcCheckTaskIncomeDTO.setOrderType("8040");//包材固定码
// qcCheckTaskIncomeDTO.setUnit("KG");
// qcCheckTaskIncomeDTO.setQuality(new BigDecimal("10"));
// qcCheckTaskIncomeDTO.setMaterialCode("000000040000011094");
// qcCheckTaskIncomeDTO.setMaterialName("LANJU 出口封口胶(1000米/卷)(1901)");
// qcCheckTaskIncomeDTO.setIncomeBatchNo("202312250001");
// qcCheckTaskIncomeDTO.setOrderNo("4500297568");
// qcCheckTaskIncomeDTO.setIncomeTime(new Date());
// remoteQualityService.createIncomeTask(qcCheckTaskIncomeDTO);
// 品质检验
// QcCheckUnqualified task = new QcCheckUnqualified();
// task.setTaskId("3ffb199037ba46a48e39cb148d7ad9e0");
// task.setUser("002007");
// task.setSqbm("0");
// task.setSqr("MSL#002007");
// task.setSccj("MSD#10000152");
// task.setQuality("100");
// task.setCheckLoc("测试发现地点");
// task.setOaFactoryF("0");
// task.setSfxyzg("0");
// task.setPgzg("MSL#019184");
// task.setPgzr("MSL#019184");
// task.setSfgyswt("0");
// this.createProduceOA(task);
return qcGoals;
}
private AjaxResult createLLOA(QcCheckUnqualified task){
//QcCheckTaskIncome detailInfo = qcCheckTaskIncomeMapper.getTaskInfo(task.getTaskId());
//发起来料检验OA流程
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("user",task.getUser());//提交人工号
paramMap.put("requestLevel",0);//流程紧急度
paramMap.put("requestName","ZL0010-来料检验不合格控制流程");//流程名称
paramMap.put("workflowId",113454);//该流程对应的唯- workFlowld
if(StringUtils.isEmpty(task.getIncomeBatchNo())){
task.setIncomeBatchNo(DateUtils.parseDateToStr("yyyyMMdd",new Date()));
}
StringBuffer mainObject = new StringBuffer();
mainObject.append("{");
mainObject.append("\"SQR\":"+"\""+task.getSqr()+"\"");//申请人--
mainObject.append(",\"CQ\":"+task.getOaFactory());//厂区--
mainObject.append(",\"LLLB\":"+task.getMaterialType());//来料类别【0、1】
mainObject.append(",\"MATNR\":"+"\""+task.getMaterialCode()+"\"");//物料编码
mainObject.append(",\"MAKTX\":"+"\""+task.getMaterialName()+"\"");//物料名称
mainObject.append(",\"suppliernum\":"+"\""+task.getSupplierCode()+"\"");//供应商编码
mainObject.append(",\"supplier\":"+"\""+task.getSupplierName()+"\"");//供应商名称
mainObject.append(",\"CHARG\":"+"\""+task.getIncomeBatchNo()+"\"");//生产批号
mainObject.append(",\"comeQty\":"+"\""+task.getQuality()+"\"");//来料数量
mainObject.append(",\"DW\":"+"\""+task.getUnit()+"\"");//来料单位
mainObject.append(",\"testDate\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd",new Date())+"\"");//检验日期
mainObject.append(",\"JYBH\":"+"\""+task.getCheckNo()+"\"");//检验编码
mainObject.append(",\"BJY\":"+"\""+task.getCzbjr()+"\"");//仓储报检人--
mainObject.append(",\"WLLY\":"+"\""+task.getMaterialFrom()+"\"");//物料来源
mainObject.append(",\"ZCF\":"+"\""+task.getZcf()+"\"");//转出方
mainObject.append(",\"ZCOEMCM\":"+"\""+task.getZcoemcm()+"\"");//转出OEM厂名
mainObject.append(",\"memo\":"+"\""+task.getRemark()+"\"");//不合格描述
mainObject.append(",\"PZGLBZG\":"+"\""+task.getQczg()+"\"");//qc主管--
mainObject.append("}");
paramMap.put("mainObject",mainObject.toString());
logger.info("流程Id 113454:"+ JSONObject.toJSONString(paramMap));
AjaxResult oaR = remoteOpenService.OAInspection(paramMap);
logger.info("流程Id 113454:"+ JSONObject.toJSONString(oaR));
return oaR;
}
private AjaxResult createProduceOA(QcCheckUnqualified task){
QcCheckTaskIncome detailInfo = qcCheckTaskIncomeMapper.getTaskInfo(task.getTaskId());
//发起来料检验OA流程
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("user",task.getUser());//提交人工号
paramMap.put("requestLevel",0);//流程紧急度
paramMap.put("requestName","ZL0030-品质异常流程-智能制造-"+DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",detailInfo.getIncomeTime())+"(产品名称:"+detailInfo.getMaterialName()+"");//流程名称
paramMap.put("workflowId",113455);//该流程对应的唯- workFlowld
StringBuffer mainObject = new StringBuffer();
mainObject.append("{");
mainObject.append("\"CPMC\":"+"\""+detailInfo.getMaterialName()+"\"");//产品名称
mainObject.append(",\"CPBM\":"+"\""+detailInfo.getMaterialCode()+"\"");//产品编码
mainObject.append(",\"SQBM\":"+"\""+task.getSqbm()+"\"");//0品质保障部
mainObject.append(",\"SQR\":"+"\""+task.getSqr()+"\"");//申请人:默认当前用户
mainObject.append(",\"SQSJ\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd",detailInfo.getCheckTime())+"\"");//申请时间
mainObject.append(",\"SCCJ\":"+"\""+task.getSccj()+"\"");//所属车间
mainObject.append(",\"SCPH\":"+"\""+detailInfo.getIncomeBatchNo()+"\"");//生产批号
mainObject.append(",\"SCSL\":"+task.getQuality());//生产数量
mainObject.append(",\"FXDD\":"+"\""+task.getCheckLoc()+"\"");//发现地点
mainObject.append(",\"FXRQ\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd",detailInfo.getCheckTime())+"\"");//发现日期
mainObject.append(",\"BH\":"+"\""+detailInfo.getCheckNo()+"\"");//编号:流水号 年月日+四位流水号
mainObject.append(",\"YCFW\":"+"\""+task.getOaFactoryF()+"\"");//*异常范围:下拉框榄菊所有工厂 1代表小榄工厂
mainObject.append(",\"PZYCMS\":"+"\""+detailInfo.getRemark()+"\"");//品质异常描述
mainObject.append(",\"Notes\":"+"\"\"");//测试备注
mainObject.append(",\"SFXYZG\":"+"\""+task.getSfxyzg()+"\"");//*是否需要主管审核 1否 0是
mainObject.append(",\"PGZG\":"+"\""+task.getPgzg()+"\"");//QC主管SFXYZG字段为"是",则此项选择QC主管信息
mainObject.append(",\"PGZR\":"+"\""+task.getPgzr()+"\"");//质量主管 660朱继新
mainObject.append(",\"SFGYSWT\":"+"\""+task.getSfgyswt()+"\"");//*是否供应商问题 1非供应商问题 0是供应商问题
mainObject.append("}");
paramMap.put("mainObject",mainObject.toString());
logger.info("流程Id 113455:"+ JSONObject.toJSONString(paramMap));
AjaxResult oaR = remoteOpenService.OAInspection(paramMap);
logger.info("流程Id 113455:"+ JSONObject.toJSONString(oaR));
return oaR;
}
@Override
@DS("#header.poolName")
public List<QcGoal> selectChildrenByParent(QcGoal goal) {

@ -54,7 +54,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
}
/**
*
*
* @param qcMaterialGroup
* @return
*/

@ -632,9 +632,20 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
public static double calculateCpk(double[] data, double USL, double LSL) {
double mean = calculateMean(data);
double stdDev = calculateStandardDeviation(data);
double cpkUpper = (USL - mean) / (3 * stdDev);
double cpkLower = (mean - LSL) / (3 * stdDev);
return Math.min(cpkUpper, cpkLower);
if(new BigDecimal(USL).compareTo(BigDecimal.ZERO)>0 && new BigDecimal(LSL).compareTo(BigDecimal.ZERO)>0){
double cpkUpper = (USL - mean) / (3 * stdDev);
double cpkLower = (mean - LSL) / (3 * stdDev);
return Math.min(cpkUpper, cpkLower);
}else if(new BigDecimal(USL).compareTo(BigDecimal.ZERO)==0 && new BigDecimal(LSL).compareTo(BigDecimal.ZERO)>0){
//无上限
double cpkLower = (mean - LSL) / (3 * stdDev);
return cpkLower;
}else if(new BigDecimal(USL).compareTo(BigDecimal.ZERO)>0 && new BigDecimal(LSL).compareTo(BigDecimal.ZERO)==0){
//无下限
double cpkUpper = (USL - mean) / (3 * stdDev);
return cpkUpper;
}
return 0;
}
// 计算均值
public static double calculateMean(double[] data) {
@ -736,5 +747,8 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
return days;
}
public static void main(String args[]){
double a = 0.01;
System.out.println(new BigDecimal(a).compareTo(BigDecimal.ZERO));
}
}

@ -574,7 +574,7 @@
where del_flag='0' and sample_code like concat(#{sampleCode},'%')
</select>
<select id="getUserIdList" resultType="com.op.system.api.domain.SysUser">
select oa_user_id userId,
select user_name userCode,
nick_name userName
from sys_user where dept_id = #{deptId} and del_flag='0'
</select>

@ -307,13 +307,20 @@
where del_flag = '0'
</select>
<select id="getProductGroup" resultType="com.op.quality.domain.QcProjectType">
select bp.product_group productGroup,
<!--select bp.product_group productGroup,
bp.product_group_name productGroupName,
qmg.id groupId
from base_product bp
left join qc_material_group qmg on qmg.group_code = bp.product_group
where bp.product_code like concat('%',#{materialCode},'%')
and bp.del_flag = '0'-->
select top 1 qmg.id groupId
from base_product bp
left join qc_material_group qmg on qmg.group_code = bp.mvgr5
where bp.product_code like concat('%',#{materialCode},'%')
and bp.del_flag = '0'
order by qmg.create_time desc
</select>
<select id="selectExist" resultType="com.op.quality.domain.QcMaterialGroupDetail">
select material_name from qc_material_group_detail

@ -14,10 +14,14 @@
<result property="updateTime" column="update_time"/>
<result property="factoryCode" column="factory_code"/>
<result property="delFlag" column="del_flag"/>
<result property="groupCode" column="group_code"/>
</resultMap>
<sql id="selectQcMaterialGroupVo">
select id, group_name, attr1, create_by, create_time, update_by, update_time, factory_code, del_flag from qc_material_group
select id, group_name, attr1, create_by, create_time,
update_by, update_time, factory_code, del_flag
from qc_material_group
</sql>
<select id="selectQcMaterialGroupList" parameterType="QcMaterialGroup" resultMap="QcMaterialGroupResult">
@ -40,10 +44,10 @@
<select id="getOriginalGroupList" parameterType="QcMaterialGroup" resultType="QcMaterialGroup">
SELECT DISTINCT
product_group groupCode,
concat(product_group_name,'(',product_group,')') groupName
mvgr5 groupCode,
mvgr5 groupName
FROM base_product
WHERE del_flag = '0' AND product_group_name IS NOT NULL
WHERE del_flag = '0' AND mvgr5 IS NOT NULL
</select>
<select id="getMaterialChildrenList" parameterType="QcMaterialGroup" resultMap="QcMaterialGroupResult">
@ -61,7 +65,10 @@
<select id="selectQcMaterialGroupById" parameterType="String" resultMap="QcMaterialGroupResult">
<include refid="selectQcMaterialGroupVo"/>
select id, group_name, attr1, create_by, create_time,
update_by, update_time, factory_code, del_flag,
group_code
from qc_material_group
where id = #{id}
</select>

@ -67,6 +67,10 @@ public class SapMaterialPreparationServiceImpl implements SapMaterialPreparation
String BDMNG = maraTable.getString("BDMNG");
String ZQLSL = maraTable.getString("ZQLSL");
String MEINS = maraTable.getString("MEINS");
String ERFMG = maraTable.getString("ERFMG");
String ERFME = maraTable.getString("ERFME");
String RGEKZ = maraTable.getString("RGEKZ");
String DBSKZ = maraTable.getString("DBSKZ");
log.info("备料单输出------" + "订单号:" + AUFNR
@ -79,20 +83,10 @@ public class SapMaterialPreparationServiceImpl implements SapMaterialPreparation
" - 需求量:" + BDMNG +
" - 欠料数量:" + ZQLSL +
" - 基本计量单位:" + MEINS +
" - 以输入单位计的数量:" + ERFMG +
" - 条目单位:" + ERFME +
" - 标识:反冲:" + RGEKZ +
" - 直接采购标识:" + DBSKZ);
// System.out.println("订单号:" + AUFNR
// + " - 预留/相关需求的项目编号:" + RSPOS +
// " - 物料号:" + MATNR +
// " - 物料描述(短文本):" + MAKTX +
// " - 工厂:" + WERKS +
// " - 库存地点:" + LGORT +
// " - 组件的需求日期 " + BDTER +
// " - 需求量:" + BDMNG +
// " - 欠料数量:" + ZQLSL +
// " - 基本计量单位:" + MEINS +
// " - 标识:反冲:" + RGEKZ +
// " - 直接采购标识:" + DBSKZ );
SapMaterialPreparation sapMaterialPreparation = new SapMaterialPreparation();
sapMaterialPreparation.setAUFNR(AUFNR);
sapMaterialPreparation.setBDMNG(BDMNG);
@ -106,6 +100,10 @@ public class SapMaterialPreparationServiceImpl implements SapMaterialPreparation
sapMaterialPreparation.setRSPOS(RSPOS);
sapMaterialPreparation.setWERKS(WERKS);
sapMaterialPreparation.setZQLSL(ZQLSL);
sapMaterialPreparation.setERFMG(ERFMG);
sapMaterialPreparation.setERFME(ERFME);
sapMaterialPreparationList.add(sapMaterialPreparation);
}
String MSG = func.getExportParameterList().getString("MSG");

Loading…
Cancel
Save