计件薪酬、包装线看板接口

master
Yangwl 1 year ago
parent 8bc7cd17ce
commit 61c37758f8

@ -147,4 +147,10 @@ public class Constants {
//领料 //领料
public static final Integer LL=261; public static final Integer LL=261;
//来料检验不合格控制流程workflowId
public static final Integer WORKFLOWID=26235;
//过程检验不合格控制流程workflowId
} }

@ -0,0 +1,28 @@
package com.op.mes.controller;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.service.IMesBoradService;
import com.op.system.api.domain.dto.BoardDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/mesborad")
public class MesBoardController {
@Autowired
private IMesBoradService iMesBoradService;
/**
* 线
*/
@PostMapping("/finishProductBoard")
public AjaxResult finishProductBoard(@RequestBody BoardDTO boardDTO){
return iMesBoradService.finishProductBoard(boardDTO);
}
}

@ -5,6 +5,7 @@ import com.op.mes.service.MesInterfaceService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -26,4 +27,5 @@ public class MesInterfaceController {
public List<MesBoard> getTechnologyBoard(@RequestBody MesBoard mesBoard) { public List<MesBoard> getTechnologyBoard(@RequestBody MesBoard mesBoard) {
return mesInterfaceService.getTechnologyBoard(mesBoard); return mesInterfaceService.getTechnologyBoard(mesBoard);
} }
} }

@ -0,0 +1,105 @@
package com.op.mes.controller;
import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.mes.domain.MesUnitPrice;
import com.op.mes.service.IMesUnitPriceService;
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.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* unitPriceController
*
* @author Open Platform
* @date 2023-12-26
*/
@RestController
@RequestMapping("/unitPrice")
public class MesUnitPriceController extends BaseController {
@Autowired
private IMesUnitPriceService mesUnitPriceService;
/**
* unitPrice
*/
@RequiresPermissions("system:unitPrice:list")
@GetMapping("/list")
public TableDataInfo list(MesUnitPrice mesUnitPrice) {
startPage();
List<MesUnitPrice> list = mesUnitPriceService.selectMesUnitPriceList(mesUnitPrice);
return getDataTable(list);
}
/**
* unitPrice
*/
@RequiresPermissions("system:unitPrice:export")
@Log(title = "unitPrice", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesUnitPrice mesUnitPrice) {
List<MesUnitPrice> list = mesUnitPriceService.selectMesUnitPriceList(mesUnitPrice);
ExcelUtil<MesUnitPrice> util = new ExcelUtil<MesUnitPrice>(MesUnitPrice.class);
util.exportExcel(response, list, "unitPrice数据");
}
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) throws IOException {
ExcelUtil<MesUnitPrice> util = new ExcelUtil<MesUnitPrice>(MesUnitPrice.class);
util.importTemplateExcel(response, "产品单价导入模板");
}
/**
* unitPrice
*/
@RequiresPermissions("system:unitPrice:query")
@GetMapping(value = "/{picId}")
public AjaxResult getInfo(@PathVariable("picId") String picId) {
return success(mesUnitPriceService.selectMesUnitPriceByPicId(picId));
}
/**
* unitPrice
*/
@RequiresPermissions("system:unitPrice:add")
@Log(title = "unitPrice", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesUnitPrice mesUnitPrice) {
return toAjax(mesUnitPriceService.insertMesUnitPrice(mesUnitPrice));
}
/**
* unitPrice
*/
@RequiresPermissions("system:unitPrice:edit")
@Log(title = "unitPrice", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesUnitPrice mesUnitPrice) {
return toAjax(mesUnitPriceService.updateMesUnitPrice(mesUnitPrice));
}
/**
* unitPrice
*/
@RequiresPermissions("system:unitPrice:remove")
@Log(title = "unitPrice", businessType = BusinessType.DELETE)
@DeleteMapping("/{picIds}")
public AjaxResult remove(@PathVariable String[] picIds) {
return toAjax(mesUnitPriceService.deleteMesUnitPriceByPicIds(picIds));
}
}

@ -0,0 +1,125 @@
package com.op.mes.controller;
import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.common.security.utils.SecurityUtils;
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.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.mes.domain.ProProcessChild;
import com.op.mes.service.IProProcessChildService;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* unitpriceController
*
* @author Open Platform
* @date 2023-12-19
*/
@RestController
@RequestMapping("/childprocess")
public class ProProcessChildController extends BaseController {
@Autowired
private IProProcessChildService proProcessChildService;
/**
* childprocess
*/
@RequiresPermissions("mes:childprocess:list")
@GetMapping("/list")
public TableDataInfo list(ProProcessChild proProcessChild) {
startPage();
List<ProProcessChild> list = proProcessChildService.selectProProcessChildList(proProcessChild);
return getDataTable(list);
}
@RequiresPermissions("mes:childprocess:listall")
@GetMapping("/listall")
public List<ProProcessChild> listall(ProProcessChild proProcessChild) {
List<ProProcessChild> list = proProcessChildService.selectProProcessChildList(proProcessChild);
return list;
}
/**
* unitprice
*/
@RequiresPermissions("mes:childprocess:export")
@Log(title = "childprocess", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProProcessChild proProcessChild) {
List<ProProcessChild> list = proProcessChildService.selectProProcessChildList(proProcessChild);
ExcelUtil<ProProcessChild> util = new ExcelUtil<ProProcessChild>(ProProcessChild.class);
util.exportExcel(response, list, "unitprice数据");
}
@Log(title = "子工序管理", businessType = BusinessType.IMPORT)
@RequiresPermissions("mes:childprocess:import")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
ExcelUtil<ProProcessChild> util = new ExcelUtil<ProProcessChild>(ProProcessChild.class);
List<ProProcessChild> proProcessChildList = util.importExcel(file.getInputStream());
String operName = SecurityUtils.getUsername();
String message = proProcessChildService.importProcessChild(proProcessChildList, updateSupport, operName);
return success(message);
}
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) throws IOException {
ExcelUtil<ProProcessChild> util = new ExcelUtil<ProProcessChild>(ProProcessChild.class);
util.importTemplateExcel(response, "子工序数据");
}
/**
* unitprice
*/
@RequiresPermissions("mes:childprocess:query")
@GetMapping(value = "/{childprocessId}")
public AjaxResult getInfo(@PathVariable("childprocessId") String childprocessId) {
return success(proProcessChildService.selectProProcessChildByChildprocessId(childprocessId));
}
/**
* unitprice
*/
@RequiresPermissions("mes:unitprice:add")
@Log(title = "unitprice", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProProcessChild proProcessChild) {
return toAjax(proProcessChildService.insertProProcessChild(proProcessChild));
}
/**
* unitprice
*/
@RequiresPermissions("mes:childprocess:edit")
@Log(title = "childprocess", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProProcessChild proProcessChild) {
return toAjax(proProcessChildService.updateProProcessChild(proProcessChild));
}
/**
* unitprice
*/
@RequiresPermissions("mes:unitprice:remove")
@Log(title = "childprocess", businessType = BusinessType.DELETE)
@DeleteMapping("/{childprocessIds}")
public AjaxResult remove(@PathVariable String[] childprocessIds) {
return toAjax(proProcessChildService.deleteProProcessChildByChildprocessIds(childprocessIds));
}
}

@ -0,0 +1,182 @@
package com.op.mes.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* ${subTable.functionName} mes_unit_price
*
* @author Open Platform
* @date 2023-12-19
*/
public class MesUnitPrice extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 单价表主键 */
private String picId;
/** 工厂 */
@Excel(name = "工厂")
private Integer factoryId;
/** 物料码 */
@Excel(name = "产品编码")
private String productCode;
/** 物料描述 */
@Excel(name = "产品名称")
private String productName;
/** 产线编码 */
@Excel(name = "产线编码")
private String lineCode;
/** 产线名称 */
@Excel(name = "产线名称")
private String lineName;
/** 子工序主键 */
// @Excel(name = "子工序主键")
private String childprocessId;
/** 子工序编码 */
@Excel(name = "子工序编码")
private String childprocessCode;
/** 子工序名称 */
@Excel(name = "子工序名称")
private String childprocessName;
/** 预留字段1 */
@Excel(name = "工序单价(元/pc")
private String attr1;
/** 预留字段2 */
// @Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
// @Excel(name = "预留字段3")
private Long attr3;
/** 预留字段4 */
// @Excel(name = "预留字段4")
private Long attr4;
public void setPicId(String picId) {
this.picId = picId;
}
public String getPicId() {
return picId;
}
public void setFactoryId(Integer factoryId) {
this.factoryId = factoryId;
}
public Integer getFactoryId() {
return factoryId;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductCode() {
return productCode;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductName() {
return productName;
}
public void setLineCode(String lineCode) {
this.lineCode = lineCode;
}
public String getLineCode() {
return lineCode;
}
public void setLineName(String lineName) {
this.lineName = lineName;
}
public String getLineName() {
return lineName;
}
public void setChildprocessId(String childprocessId) {
this.childprocessId = childprocessId;
}
public String getChildprocessId() {
return childprocessId;
}
public void setChildprocessCode(String childprocessCode) {
this.childprocessCode = childprocessCode;
}
public String getChildprocessCode() {
return childprocessCode;
}
public void setChildprocessName(String childprocessName) {
this.childprocessName = childprocessName;
}
public String getChildprocessName() {
return childprocessName;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(Long attr3) {
this.attr3 = attr3;
}
public Long getAttr3() {
return attr3;
}
public void setAttr4(Long attr4) {
this.attr4 = attr4;
}
public Long getAttr4() {
return attr4;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("picId", getPicId())
.append("factoryId", getFactoryId())
.append("productCode", getProductCode())
.append("productName", getProductName())
.append("lineCode", getLineCode())
.append("lineName", getLineName())
.append("childprocessId", getChildprocessId())
.append("childprocessCode", getChildprocessCode())
.append("childprocessName", getChildprocessName())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,135 @@
package com.op.mes.domain;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* unitprice pro_process_child
*
* @author Open Platform
* @date 2023-12-19
*/
public class ProProcessChild extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 子工序id */
private String childprocessId;
/** 工厂 */
@Excel(name = "工厂")
private String factoryId;
/** 子工序编码 */
@Excel(name = "子工序编码")
private String childprocessCode;
/** 子工序名称 */
@Excel(name = "子工序名称")
private String childprocessName;
/** 预留字段1 */
// @Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
// @Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
// @Excel(name = "预留字段3")
private Long attr3;
/** 预留字段4 */
// @Excel(name = "预留字段4")
private Long attr4;
/** $table.subTable.functionName信息 */
private List<MesUnitPrice> mesUnitPriceList;
public void setChildprocessId(String childprocessId) {
this.childprocessId = childprocessId;
}
public String getChildprocessId() {
return childprocessId;
}
public void setFactoryId(String factoryId) {
this.factoryId = factoryId;
}
public String getFactoryId() {
return factoryId;
}
public void setChildprocessCode(String childprocessCode) {
this.childprocessCode = childprocessCode;
}
public String getChildprocessCode() {
return childprocessCode;
}
public void setChildprocessName(String childprocessName) {
this.childprocessName = childprocessName;
}
public String getChildprocessName() {
return childprocessName;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(Long attr3) {
this.attr3 = attr3;
}
public Long getAttr3() {
return attr3;
}
public void setAttr4(Long attr4) {
this.attr4 = attr4;
}
public Long getAttr4() {
return attr4;
}
public List<MesUnitPrice> getMesUnitPriceList() {
return mesUnitPriceList;
}
public void setMesUnitPriceList(List<MesUnitPrice> mesUnitPriceList) {
this.mesUnitPriceList = mesUnitPriceList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("childprocessId", getChildprocessId())
.append("factoryId", getFactoryId())
.append("childprocessCode", getChildprocessCode())
.append("childprocessName", getChildprocessName())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("mesUnitPriceList", getMesUnitPriceList())
.toString();
}
}

@ -64,4 +64,12 @@ public interface MesMapper {
List<MesBoard> getTechnologyBoard(MesBoard mesBoard); List<MesBoard> getTechnologyBoard(MesBoard mesBoard);
List<BaseFileData> getTechnologyFiles(MesBoard dto); List<BaseFileData> getTechnologyFiles(MesBoard dto);
String sumPlanQuantity();
String sumFinshQuantity();
List<Map<String, String>> daySenvenProduction();
List<Map<String, String>> ProductionInProgress();
} }

@ -0,0 +1,63 @@
package com.op.mes.mapper;
import com.op.mes.domain.MesUnitPrice;
import java.util.List;
/**
* unitPriceMapper
*
* @author Open Platform
* @date 2023-12-26
*/
public interface MesUnitPriceMapper {
/**
* unitPrice
*
* @param picId unitPrice
* @return unitPrice
*/
public MesUnitPrice selectMesUnitPriceByPicId(String picId);
/**
* unitPrice
*
* @param mesUnitPrice unitPrice
* @return unitPrice
*/
public List<MesUnitPrice> selectMesUnitPriceList(MesUnitPrice mesUnitPrice);
/**
* unitPrice
*
* @param mesUnitPrice unitPrice
* @return
*/
public int insertMesUnitPrice(MesUnitPrice mesUnitPrice);
/**
* unitPrice
*
* @param mesUnitPrice unitPrice
* @return
*/
public int updateMesUnitPrice(MesUnitPrice mesUnitPrice);
/**
* unitPrice
*
* @param picId unitPrice
* @return
*/
public int deleteMesUnitPriceByPicId(String picId);
/**
* unitPrice
*
* @param picIds
* @return
*/
public int deleteMesUnitPriceByPicIds(String[] picIds);
}

@ -0,0 +1,89 @@
package com.op.mes.mapper;
import java.util.List;
import com.op.mes.domain.ProProcessChild;
import com.op.mes.domain.MesUnitPrice;
/**
* unitpriceMapper
*
* @author Open Platform
* @date 2023-12-19
*/
public interface ProProcessChildMapper {
/**
* unitprice
*
* @param childprocessId unitprice
* @return unitprice
*/
public ProProcessChild selectProProcessChildByChildprocessId(String childprocessId);
/**
* unitprice
*
* @param proProcessChild unitprice
* @return unitprice
*/
public List<ProProcessChild> selectProProcessChildList(ProProcessChild proProcessChild);
/**
* unitprice
*
* @param proProcessChild unitprice
* @return
*/
public int insertProProcessChild(ProProcessChild proProcessChild);
/**
* unitprice
*
* @param proProcessChild unitprice
* @return
*/
public int updateProProcessChild(ProProcessChild proProcessChild);
/**
* unitprice
*
* @param childprocessId unitprice
* @return
*/
public int deleteProProcessChildByChildprocessId(String childprocessId);
/**
* unitprice
*
* @param childprocessIds
* @return
*/
public int deleteProProcessChildByChildprocessIds(String[] childprocessIds);
/**
* ${subTable.functionName}
*
* @param childprocessIds
* @return
*/
public int deleteMesUnitPriceByChildprocessIds(String[] childprocessIds);
/**
* ${subTable.functionName}
*
* @param mesUnitPriceList ${subTable.functionName}
* @return
*/
public int batchMesUnitPrice(List<MesUnitPrice> mesUnitPriceList);
/**
* unitprice${subTable.functionName}
*
* @param childprocessId unitpriceID
* @return
*/
public int deleteMesUnitPriceByChildprocessId(String childprocessId);
ProProcessChild selectProcessChildByCode(String childprocessCode);
}

@ -0,0 +1,8 @@
package com.op.mes.service;
import com.op.common.core.web.domain.AjaxResult;
import com.op.system.api.domain.dto.BoardDTO;
public interface IMesBoradService {
public AjaxResult finishProductBoard(BoardDTO boardDTO);
}

@ -0,0 +1,62 @@
package com.op.mes.service;
import com.op.mes.domain.MesUnitPrice;
import java.util.List;
/**
* unitPriceService
*
* @author Open Platform
* @date 2023-12-26
*/
public interface IMesUnitPriceService {
/**
* unitPrice
*
* @param picId unitPrice
* @return unitPrice
*/
public MesUnitPrice selectMesUnitPriceByPicId(String picId);
/**
* unitPrice
*
* @param mesUnitPrice unitPrice
* @return unitPrice
*/
public List<MesUnitPrice> selectMesUnitPriceList(MesUnitPrice mesUnitPrice);
/**
* unitPrice
*
* @param mesUnitPrice unitPrice
* @return
*/
public int insertMesUnitPrice(MesUnitPrice mesUnitPrice);
/**
* unitPrice
*
* @param mesUnitPrice unitPrice
* @return
*/
public int updateMesUnitPrice(MesUnitPrice mesUnitPrice);
/**
* unitPrice
*
* @param picIds unitPrice
* @return
*/
public int deleteMesUnitPriceByPicIds(String[] picIds);
/**
* unitPrice
*
* @param picId unitPrice
* @return
*/
public int deleteMesUnitPriceByPicId(String picId);
}

@ -0,0 +1,62 @@
package com.op.mes.service;
import java.util.List;
import com.op.mes.domain.ProProcessChild;
/**
* unitpriceService
*
* @author Open Platform
* @date 2023-12-19
*/
public interface IProProcessChildService {
/**
* unitprice
*
* @param childprocessId unitprice
* @return unitprice
*/
public ProProcessChild selectProProcessChildByChildprocessId(String childprocessId);
/**
* unitprice
*
* @param proProcessChild unitprice
* @return unitprice
*/
public List<ProProcessChild> selectProProcessChildList(ProProcessChild proProcessChild);
/**
* unitprice
*
* @param proProcessChild unitprice
* @return
*/
public int insertProProcessChild(ProProcessChild proProcessChild);
/**
* unitprice
*
* @param proProcessChild unitprice
* @return
*/
public int updateProProcessChild(ProProcessChild proProcessChild);
/**
* unitprice
*
* @param childprocessIds unitprice
* @return
*/
public int deleteProProcessChildByChildprocessIds(String[] childprocessIds);
/**
* unitprice
*
* @param childprocessId unitprice
* @return
*/
public int deleteProProcessChildByChildprocessId(String childprocessId);
String importProcessChild(List<ProProcessChild> proProcessChildList, boolean updateSupport, String operName);
}

@ -0,0 +1,37 @@
package com.op.mes.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.mapper.MesMapper;
import com.op.mes.service.IMesBoradService;
import com.op.system.api.domain.dto.BoardDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class MesBoradServiceImpl implements IMesBoradService {
@Autowired
private MesMapper mesMapper;
@Override
public AjaxResult finishProductBoard(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push("ds_"+boardDTO.getFactory());// 这是数据源的key
Map map=new HashMap();
//当日成品计划数量
String sumplanquantity=mesMapper.sumPlanQuantity();
String sumFinshQuantity=mesMapper.sumFinshQuantity();
List<Map<String, String>> daySenvenProductionList= mesMapper.daySenvenProduction();
List<Map<String, String>> ProductionInProgress=mesMapper.ProductionInProgress();
map.put("sumplanquantity",sumplanquantity);
map.put("sumFinshQuantity",sumFinshQuantity);
map.put("daySenvenProductionList",daySenvenProductionList);
map.put("ProductionInProgress",ProductionInProgress);
return AjaxResult.success(map);
}
}

@ -0,0 +1,93 @@
package com.op.mes.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.mes.domain.MesUnitPrice;
import com.op.mes.mapper.MesUnitPriceMapper;
import com.op.mes.service.IMesUnitPriceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* unitPriceService
*
* @author Open Platform
* @date 2023-12-26
*/
@Service
public class MesUnitPriceServiceImpl implements IMesUnitPriceService {
@Autowired
private MesUnitPriceMapper mesUnitPriceMapper;
/**
* unitPrice
*
* @param picId unitPrice
* @return unitPrice
*/
@Override
public MesUnitPrice selectMesUnitPriceByPicId(String picId) {
return mesUnitPriceMapper.selectMesUnitPriceByPicId(picId);
}
/**
* unitPrice
*
* @param mesUnitPrice unitPrice
* @return unitPrice
*/
@Override
@DS("#header.poolName")
public List<MesUnitPrice> selectMesUnitPriceList(MesUnitPrice mesUnitPrice) {
return mesUnitPriceMapper.selectMesUnitPriceList(mesUnitPrice);
}
/**
* unitPrice
*
* @param mesUnitPrice unitPrice
* @return
*/
@Override
public int insertMesUnitPrice(MesUnitPrice mesUnitPrice) {
mesUnitPrice.setCreateTime(DateUtils.getNowDate());
return mesUnitPriceMapper.insertMesUnitPrice(mesUnitPrice);
}
/**
* unitPrice
*
* @param mesUnitPrice unitPrice
* @return
*/
@Override
public int updateMesUnitPrice(MesUnitPrice mesUnitPrice) {
mesUnitPrice.setUpdateTime(DateUtils.getNowDate());
return mesUnitPriceMapper.updateMesUnitPrice(mesUnitPrice);
}
/**
* unitPrice
*
* @param picIds unitPrice
* @return
*/
@Override
public int deleteMesUnitPriceByPicIds(String[] picIds) {
return mesUnitPriceMapper.deleteMesUnitPriceByPicIds(picIds);
}
/**
* unitPrice
*
* @param picId unitPrice
* @return
*/
@Override
public int deleteMesUnitPriceByPicId(String picId) {
return mesUnitPriceMapper.deleteMesUnitPriceByPicId(picId);
}
}

@ -0,0 +1,189 @@
package com.op.mes.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.exception.ServiceException;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.bean.BeanValidators;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.utils.uuid.UUID;
import com.op.common.security.utils.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import com.op.common.core.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.op.mes.domain.MesUnitPrice;
import com.op.mes.mapper.ProProcessChildMapper;
import com.op.mes.domain.ProProcessChild;
import com.op.mes.service.IProProcessChildService;
import javax.validation.Validator;
/**
* unitpriceService
*
* @author Open Platform
* @date 2023-12-19
*/
@Service
public class ProProcessChildServiceImpl implements IProProcessChildService {
private static final Logger log = LoggerFactory.getLogger(ProProcessChildServiceImpl.class);
@Autowired
protected Validator validator;
@Autowired
private ProProcessChildMapper proProcessChildMapper;
/**
* unitprice
*
* @param childprocessId unitprice
* @return unitprice
*/
@Override
public ProProcessChild selectProProcessChildByChildprocessId(String childprocessId) {
return proProcessChildMapper.selectProProcessChildByChildprocessId(childprocessId);
}
/**
* unitprice
*
* @param proProcessChild unitprice
* @return unitprice
*/
@Override
@DS("#header.poolName")
public List<ProProcessChild> selectProProcessChildList(ProProcessChild proProcessChild) {
return proProcessChildMapper.selectProProcessChildList(proProcessChild);
}
/**
* unitprice
*
* @param proProcessChild unitprice
* @return
*/
@Transactional
@Override
public int insertProProcessChild(ProProcessChild proProcessChild) {
proProcessChild.setCreateTime(DateUtils.getNowDate());
int rows = proProcessChildMapper.insertProProcessChild(proProcessChild);
insertMesUnitPrice(proProcessChild);
return rows;
}
/**
* unitprice
*
* @param proProcessChild unitprice
* @return
*/
@Transactional
@Override
public int updateProProcessChild(ProProcessChild proProcessChild) {
proProcessChild.setUpdateTime(DateUtils.getNowDate());
proProcessChildMapper.deleteMesUnitPriceByChildprocessId(proProcessChild.getChildprocessId());
insertMesUnitPrice(proProcessChild);
return proProcessChildMapper.updateProProcessChild(proProcessChild);
}
/**
* unitprice
*
* @param childprocessIds unitprice
* @return
*/
@Transactional
@Override
public int deleteProProcessChildByChildprocessIds(String[] childprocessIds) {
proProcessChildMapper.deleteMesUnitPriceByChildprocessIds(childprocessIds);
return proProcessChildMapper.deleteProProcessChildByChildprocessIds(childprocessIds);
}
/**
* unitprice
*
* @param childprocessId unitprice
* @return
*/
@Transactional
@Override
public int deleteProProcessChildByChildprocessId(String childprocessId) {
proProcessChildMapper.deleteMesUnitPriceByChildprocessId(childprocessId);
return proProcessChildMapper.deleteProProcessChildByChildprocessId(childprocessId);
}
@Override
@DS("#header.poolName")
public String importProcessChild(List<ProProcessChild> proProcessChildList, boolean isUpdateSupport, String operName) {
if (StringUtils.isNull(proProcessChildList) || proProcessChildList.size() == 0) {
throw new ServiceException("导入子工序数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
for (ProProcessChild processChild : proProcessChildList) {
try {
// 验证是否存在这个子工序
ProProcessChild u = proProcessChildMapper.selectProcessChildByCode(processChild.getChildprocessCode());
if (StringUtils.isNull(u)) {
BeanValidators.validateWithException(validator, processChild);
processChild.setChildprocessId(IdUtils.fastSimpleUUID());
processChild.setCreateBy(operName);
processChild.setCreateTime(DateUtils.getNowDate());
proProcessChildMapper.insertProProcessChild(processChild);
successNum++;
successMsg.append("<br/>" + successNum + "、子工序 " + processChild.getChildprocessName() + " 导入成功");
} else if (isUpdateSupport) {
BeanValidators.validateWithException(validator, processChild);
processChild.setChildprocessId(u.getChildprocessId());
processChild.setUpdateBy(operName);
processChild.setUpdateTime(DateUtils.getNowDate());
proProcessChildMapper.updateProProcessChild(processChild);
successNum++;
successMsg.append("<br/>" + successNum + "、子工序 " + processChild.getChildprocessName() + " 更新成功");
} else {
failureNum++;
failureMsg.append("<br/>" + failureNum + "、子工序 " + processChild.getChildprocessName() + " 已存在");
}
} catch (Exception e) {
failureNum++;
String msg = "<br/>" + failureNum + "、子工序 " + processChild.getChildprocessName() + " 导入失败:";
failureMsg.append(msg + e.getMessage());
log.error(msg, e);
}
}
if (failureNum > 0) {
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new ServiceException(failureMsg.toString());
} else {
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
}
/**
* ${subTable.functionName}
*
* @param proProcessChild unitprice
*/
public void insertMesUnitPrice(ProProcessChild proProcessChild) {
List<MesUnitPrice> mesUnitPriceList = proProcessChild.getMesUnitPriceList();
String childprocessId = proProcessChild.getChildprocessId();
if (StringUtils.isNotNull(mesUnitPriceList)) {
List<MesUnitPrice> list = new ArrayList<MesUnitPrice>();
for (MesUnitPrice mesUnitPrice : mesUnitPriceList) {
mesUnitPrice.setChildprocessId(childprocessId);
list.add(mesUnitPrice);
}
if (list.size() > 0) {
proProcessChildMapper.batchMesUnitPrice(list);
}
}
}
}

@ -229,4 +229,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from base_file from base_file
where source_id = #{routeId} where source_id = #{routeId}
</select> </select>
<select id="sumPlanQuantity" resultType="java.lang.String">
SELECT
SUM(quantity) AS sumplanquantity
FROM
pro_order
WHERE
order_type = 'LJ88'
AND parent_order=''
AND CONVERT ( DATE, plan_pro_date ) = CONVERT ( DATE, GETDATE( ) )
AND CONVERT ( DATE, plan_complete ) = CONVERT ( DATE, GETDATE( ) );
</select>
<select id="sumFinshQuantity" resultType="java.lang.String">
SELECT SUM
( quantity ) AS sumplanquantity
FROM
mes_report_work
WHERE
parent_order = '0'
AND CONVERT ( DATE, create_time ) = CONVERT ( DATE, GETDATE( ) )
</select>
<select id="daySenvenProduction" resultType="java.util.Map">
SELECT
CONVERT(DATE, create_time) AS day,
SUM(quantity) AS sum_quantity
FROM
mes_report_work
WHERE
parent_order = '0'
AND CONVERT(DATE, create_time) BETWEEN DATEADD(DAY, -7, CONVERT(DATE, GETDATE())) AND CONVERT(DATE, GETDATE())
GROUP BY
CONVERT(DATE, create_time);
</select>
<select id="ProductionInProgress" resultType="java.util.Map">
SELECT
A.workorder_code,
A.workorder_name,
C.equipment_name,
A.product_name,
SUM ( B.quantity ) AS total_quantity,
A.unit
FROM
pro_order_workorder A
LEFT JOIN mes_report_work B ON A.workorder_code = B.workorder_code
LEFT JOIN base_equipment C ON A.workorder_name= C.equipment_code
WHERE
A.status = 'w2'
AND A.parent_order = '0'
AND CONVERT ( DATE, A.product_date ) = CONVERT ( DATE, GETDATE( ) )
GROUP BY
A.workorder_code,
A.workorder_name,
A.product_name,
A.workorder_name,
A.unit,
C.equipment_name;
</select>
</mapper> </mapper>

@ -0,0 +1,129 @@
<?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.op.mes.mapper.MesUnitPriceMapper">
<resultMap type="MesUnitPrice" id="MesUnitPriceResult">
<result property="picId" column="pic_id" />
<result property="factoryId" column="factory_id" />
<result property="productCode" column="product_code" />
<result property="productName" column="product_name" />
<result property="lineCode" column="line_code" />
<result property="lineName" column="line_name" />
<result property="childprocessId" column="childprocess_id" />
<result property="childprocessCode" column="childprocess_code" />
<result property="childprocessName" column="childprocess_name" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectMesUnitPriceVo">
select pic_id, factory_id, product_code, product_name, line_code, line_name, childprocess_id, childprocess_code, childprocess_name, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from mes_unit_price
</sql>
<select id="selectMesUnitPriceList" parameterType="MesUnitPrice" resultMap="MesUnitPriceResult">
<include refid="selectMesUnitPriceVo"/>
<where>
<if test="factoryId != null "> and factory_id = #{factoryId}</if>
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="lineCode != null and lineCode != ''"> and line_code = #{lineCode}</if>
<if test="lineName != null and lineName != ''"> and line_name like concat('%', #{lineName}, '%')</if>
<if test="childprocessId != null and childprocessId != ''"> and childprocess_id = #{childprocessId}</if>
<if test="childprocessCode != null and childprocessCode != ''"> and childprocess_code = #{childprocessCode}</if>
<if test="childprocessName != null and childprocessName != ''"> and childprocess_name like concat('%', #{childprocessName}, '%')</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null "> and attr3 = #{attr3}</if>
<if test="attr4 != null "> and attr4 = #{attr4}</if>
</where>
</select>
<select id="selectMesUnitPriceByPicId" parameterType="String" resultMap="MesUnitPriceResult">
<include refid="selectMesUnitPriceVo"/>
where pic_id = #{picId}
</select>
<insert id="insertMesUnitPrice" parameterType="MesUnitPrice">
insert into mes_unit_price
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="picId != null">pic_id,</if>
<if test="factoryId != null">factory_id,</if>
<if test="productCode != null">product_code,</if>
<if test="productName != null">product_name,</if>
<if test="lineCode != null">line_code,</if>
<if test="lineName != null">line_name,</if>
<if test="childprocessId != null">childprocess_id,</if>
<if test="childprocessCode != null">childprocess_code,</if>
<if test="childprocessName != null">childprocess_name,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="attr4 != null">attr4,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="picId != null">#{picId},</if>
<if test="factoryId != null">#{factoryId},</if>
<if test="productCode != null">#{productCode},</if>
<if test="productName != null">#{productName},</if>
<if test="lineCode != null">#{lineCode},</if>
<if test="lineName != null">#{lineName},</if>
<if test="childprocessId != null">#{childprocessId},</if>
<if test="childprocessCode != null">#{childprocessCode},</if>
<if test="childprocessName != null">#{childprocessName},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateMesUnitPrice" parameterType="MesUnitPrice">
update mes_unit_price
<trim prefix="SET" suffixOverrides=",">
<if test="factoryId != null">factory_id = #{factoryId},</if>
<if test="productCode != null">product_code = #{productCode},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="lineCode != null">line_code = #{lineCode},</if>
<if test="lineName != null">line_name = #{lineName},</if>
<if test="childprocessId != null">childprocess_id = #{childprocessId},</if>
<if test="childprocessCode != null">childprocess_code = #{childprocessCode},</if>
<if test="childprocessName != null">childprocess_name = #{childprocessName},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="attr4 != null">attr4 = #{attr4},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where pic_id = #{picId}
</update>
<delete id="deleteMesUnitPriceByPicId" parameterType="String">
delete from mes_unit_price where pic_id = #{picId}
</delete>
<delete id="deleteMesUnitPriceByPicIds" parameterType="String">
delete from mes_unit_price where pic_id in
<foreach item="picId" collection="array" open="(" separator="," close=")">
#{picId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,154 @@
<?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.op.mes.mapper.ProProcessChildMapper">
<resultMap type="com.op.mes.domain.ProProcessChild" id="ProProcessChildResult">
<result property="childprocessId" column="childprocess_id" />
<result property="factoryId" column="factory_id" />
<result property="childprocessCode" column="childprocess_code" />
<result property="childprocessName" column="childprocess_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
</resultMap>
<resultMap id="ProProcessChildMesUnitPriceResult" type="com.op.mes.domain.ProProcessChild" extends="ProProcessChildResult">
<collection property="mesUnitPriceList" notNullColumn="sub_pic_id" javaType="java.util.List" resultMap="MesUnitPriceResult" />
</resultMap>
<resultMap type="com.op.mes.domain.MesUnitPrice" id="MesUnitPriceResult">
<result property="picId" column="sub_pic_id" />
<result property="factoryId" column="sub_factory_id" />
<result property="productCode" column="sub_product_code" />
<result property="productName" column="sub_product_name" />
<result property="lineCode" column="sub_line_code" />
<result property="lineName" column="sub_line_name" />
<result property="childprocessId" column="sub_childprocess_id" />
<result property="childprocessCode" column="sub_childprocess_code" />
<result property="childprocessName" column="sub_childprocess_name" />
<result property="attr1" column="sub_attr1" />
<result property="attr2" column="sub_attr2" />
<result property="attr3" column="sub_attr3" />
<result property="attr4" column="sub_attr4" />
<result property="createBy" column="sub_create_by" />
<result property="createTime" column="sub_create_time" />
<result property="updateBy" column="sub_update_by" />
<result property="updateTime" column="sub_update_time" />
</resultMap>
<sql id="selectProProcessChildVo">
select childprocess_id, factory_id, childprocess_code, childprocess_name, create_by, create_time, update_by, update_time, attr1, attr2, attr3, attr4 from pro_process_child
</sql>
<select id="selectProProcessChildList" parameterType="com.op.mes.domain.ProProcessChild" resultMap="ProProcessChildResult">
<include refid="selectProProcessChildVo"/>
<where>
<if test="factoryId != null and factoryId != ''"> and factory_id = #{factoryId}</if>
<if test="childprocessCode != null and childprocessCode != ''"> and childprocess_code = #{childprocessCode}</if>
<if test="childprocessName != null and childprocessName != ''"> and childprocess_name like concat('%', #{childprocessName}, '%')</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null "> and attr3 = #{attr3}</if>
<if test="attr4 != null "> and attr4 = #{attr4}</if>
</where>
</select>
<select id="selectProProcessChildByChildprocessId" parameterType="String" resultMap="ProProcessChildMesUnitPriceResult">
select a.childprocess_id, a.factory_id, a.childprocess_code, a.childprocess_name, a.create_by, a.create_time, a.update_by, a.update_time, a.attr1, a.attr2, a.attr3, a.attr4,
b.pic_id as sub_pic_id, b.factory_id as sub_factory_id, b.product_code as sub_product_code, b.product_name as sub_product_name, b.line_code as sub_line_code, b.line_name as sub_line_name, b.childprocess_id as sub_childprocess_id, b.childprocess_code as sub_childprocess_code, b.childprocess_name as sub_childprocess_name, b.attr1 as sub_attr1, b.attr2 as sub_attr2, b.attr3 as sub_attr3, b.attr4 as sub_attr4, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time
from pro_process_child a
left join mes_unit_price b on b.childprocess_id = a.childprocess_id
where a.childprocess_id = #{childprocessId}
</select>
<select id="selectProcessChildByCode" resultType="com.op.mes.domain.ProProcessChild">
select *
from pro_process_child
where childprocess_code = #{childprocessCode}
</select>
<insert id="insertProProcessChild" parameterType="com.op.mes.domain.ProProcessChild">
insert into pro_process_child
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="childprocessId != null">childprocess_id,</if>
<if test="factoryId != null">factory_id,</if>
<if test="childprocessCode != null">childprocess_code,</if>
<if test="childprocessName != null">childprocess_name,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="attr4 != null">attr4,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="childprocessId != null">#{childprocessId},</if>
<if test="factoryId != null">#{factoryId},</if>
<if test="childprocessCode != null">#{childprocessCode},</if>
<if test="childprocessName != null">#{childprocessName},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</if>
</trim>
</insert>
<update id="updateProProcessChild" parameterType="com.op.mes.domain.ProProcessChild">
update pro_process_child
<trim prefix="SET" suffixOverrides=",">
<if test="factoryId != null">factory_id = #{factoryId},</if>
<if test="childprocessCode != null">childprocess_code = #{childprocessCode},</if>
<if test="childprocessName != null">childprocess_name = #{childprocessName},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<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="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="attr4 != null">attr4 = #{attr4},</if>
</trim>
where childprocess_id = #{childprocessId}
</update>
<delete id="deleteProProcessChildByChildprocessId" parameterType="String">
delete from pro_process_child where childprocess_id = #{childprocessId}
</delete>
<delete id="deleteProProcessChildByChildprocessIds" parameterType="String">
delete from pro_process_child where childprocess_id in
<foreach item="childprocessId" collection="array" open="(" separator="," close=")">
#{childprocessId}
</foreach>
</delete>
<delete id="deleteMesUnitPriceByChildprocessIds" parameterType="String">
delete from mes_unit_price where childprocess_id in
<foreach item="childprocessId" collection="array" open="(" separator="," close=")">
#{childprocessId}
</foreach>
</delete>
<delete id="deleteMesUnitPriceByChildprocessId" parameterType="String">
delete from mes_unit_price where childprocess_id = #{childprocessId}
</delete>
<insert id="batchMesUnitPrice">
insert into mes_unit_price( pic_id, factory_id, product_code, product_name, line_code, line_name, childprocess_id, childprocess_code, childprocess_name, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.picId}, #{item.factoryId}, #{item.productCode}, #{item.productName}, #{item.lineCode}, #{item.lineName}, #{item.childprocessId}, #{item.childprocessCode}, #{item.childprocessName}, #{item.attr1}, #{item.attr2}, #{item.attr3}, #{item.attr4}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
</foreach>
</insert>
</mapper>

@ -123,8 +123,8 @@ public class OpenController extends BaseController {
* supplier CHARG comeQty testDate JYBH * supplier CHARG comeQty testDate JYBH
* BJY OEMWLLY ZCF ZCOEMCM OEM * BJY OEMWLLY ZCF ZCOEMCM OEM
* memo PZGLBZG QC * memo PZGLBZG QC
* "workflowId": 26235
* @param paramMap * @param paramMap
*
* @return * @return
*/ */
@ -133,5 +133,18 @@ public class OpenController extends BaseController {
return openService.OAInspection(paramMap); return openService.OAInspection(paramMap);
} }
/**
* ZL0020-
*
* @param paramMap
* @return
*/
@PostMapping("/OAProcessInspection")
public AjaxResult OAProcessInspection(@RequestBody(required = false) Map<String, Object> paramMap) {
return openService.OAProcessInspection(paramMap);
}
} }

@ -30,4 +30,6 @@ public interface OpenService {
int insertQcCheckTaskProduce(QcCheckTaskProduceDTO qcCheckTaskProduce); int insertQcCheckTaskProduce(QcCheckTaskProduceDTO qcCheckTaskProduce);
AjaxResult OAInspection(Map<String, Object> paramMap); AjaxResult OAInspection(Map<String, Object> paramMap);
AjaxResult OAProcessInspection(Map<String, Object> paramMap);
} }

@ -396,7 +396,26 @@ public class OpenServiceImpl implements OpenService {
} }
} }
public static String convertJsonToUrlParams(String json) throws IOException { @Override
public AjaxResult OAProcessInspection(Map<String, Object> paramMap) {
try {
String result = HttpUtils.sendPostOA(oa_url, convertJsonToUrlParams(JSONObject.toJSONString(paramMap)));
System.out.println(result);
//返回示例{"result":"0","info":"成功","requestid":"2193799"}
Map resultMap=JSONObject.parseObject(result);
if (resultMap.get("result").equals(Constants.LOGIN_SUCCESS_STATUS)){
return success(resultMap.get("info").toString(),resultMap.get("requestid").toString());
}else {
return error(resultMap.get("info").toString());
}
} catch (Exception e) {
e.printStackTrace();
return error(e.getMessage());
}
}
public static String convertJsonToUrlParams(String json) throws IOException {
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
JsonNode jsonNode = objectMapper.readTree(json); JsonNode jsonNode = objectMapper.readTree(json);

@ -23,7 +23,7 @@ import com.op.common.core.web.page.TableDataInfo;
/** /**
* Controller * Controller
* *
* @author Open Platform * @author Open Platform
* @date 2023-07-18 * @date 2023-07-18
*/ */
@ -44,6 +44,8 @@ public class BaseProductController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/** /**
* *
*/ */

Loading…
Cancel
Save