计件薪酬、包装线看板接口
parent
8bc7cd17ce
commit
61c37758f8
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -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,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();
|
||||||
|
}
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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>
|
Loading…
Reference in New Issue