Merge remote-tracking branch 'origin/master'

master
mengjiao 5 months ago
commit f07749eafb

@ -717,6 +717,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
sapRFW.setAnzma(workOrder.getSapCode());//产线编号
sapRFW.setRemark(workOrder.getRemark());//备注
logger.info(workOrder.getWorkorderCodeSap() + "sap工单报工请求" + JSONObject.toJSONString(sapRFW));
//R r= R.ok();
R r = remoteSapService.sapRFWOrder(sapRFW);
logger.info(workOrder.getWorkorderCodeSap() + "sap工单报工结果" + r.getCode() + "," + r.getData() + "," + r.getMsg());
//上传成功更改mes_report_work状态

@ -37,7 +37,7 @@ public class IncomeTableExport extends BaseEntity {
private int okNums;
@Excel(name = "不合格数量")
private int noOkNums;
@Excel(name = "数量比例")
@Excel(name = "数量不良率")
private String noOkNumRate;
public String getSupplierId() {

@ -45,6 +45,7 @@ public class QcCheckTaskProduce extends BaseEntity {
this.incomeBatchNo = incomeBatchNo;
}
private String cpkType;
/**
*
*/
@ -63,7 +64,8 @@ public class QcCheckTaskProduce extends BaseEntity {
*/
@Excel(name = "物料名称")
private String materialName;
@Excel(name = "CPK品类")
private String cpkTypeName;
/**
*
*/
@ -210,6 +212,14 @@ public class QcCheckTaskProduce extends BaseEntity {
private String shiftId;
private String bz;//备注
public String getCpkTypeName() {
return cpkTypeName;
}
public void setCpkTypeName(String cpkTypeName) {
this.cpkTypeName = cpkTypeName;
}
public String getCpkType() {
return cpkType;
}

@ -92,8 +92,7 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
//批次不良率
if (tabledto.getBatchs() != 0) {
BigDecimal noOkBatchRate = new BigDecimal(tabledto.getNoOkBatchs()).multiply(new BigDecimal("100.00"))
.divide(new BigDecimal(tabledto.getBatchs()), BigDecimal.ROUND_CEILING)
.setScale(2, BigDecimal.ROUND_HALF_UP);
.divide(new BigDecimal(tabledto.getBatchs()), 2,BigDecimal.ROUND_HALF_UP);
tabledto.setNoOkBatchRate(noOkBatchRate.toString() + "%");
} else {
tabledto.setNoOkBatchRate("0.00%");
@ -109,8 +108,7 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
//数量不良率
if (tabledto.getNums() != 0) {
BigDecimal noOkNumRate = new BigDecimal(tabledto.getNoOkNums()).multiply(new BigDecimal("100.00"))
.divide(new BigDecimal(tabledto.getNums()), BigDecimal.ROUND_CEILING)
.setScale(2, BigDecimal.ROUND_HALF_UP);
.divide(new BigDecimal(tabledto.getNums()), 4, BigDecimal.ROUND_HALF_UP);
tabledto.setNoOkNumRate(noOkNumRate.toString() + "%");
} else {
tabledto.setNoOkNumRate("0.00%");

@ -89,6 +89,9 @@
<if test="checkTimeEnd != null ">and #{checkTimeEnd} > CONVERT(varchar(30),qct.check_time, 120)</if>
<if test="typeCode != null ">and q.type_code = #{typeCode}</if>
<if test="checkType != null ">and qct.check_type = #{checkType}</if>
<if test="workorderCodeSap != null ">and pow.workorder_code_sap like concat('%',#{workorderCodeSap}, '%')</if>
</where>
</select>

@ -72,10 +72,8 @@
<if test="materialName != null and materialName != ''">
and qct.material_name like concat('%',#{materialName}, '%')
</if>
<if test="supplierCode != null and supplierCode != ''">and qct.supplier_code = #{supplierCode}</if>
<if test="supplierName != null and supplierName != ''">and qct.supplier_name like concat('%',
#{supplierName}, '%')
</if>
<if test="supplierCode != null and supplierCode != ''">and qct.supplier_code like concat('%',#{supplierCode}, '%')</if>
<if test="supplierName != null and supplierName != ''">and qct.supplier_name like concat('%',#{supplierName}, '%')</if>
<if test="incomeTime != null ">and qct.income_time = #{incomeTime}</if>
<if test="checkLoc != null and checkLoc != ''">and qct.check_loc = #{checkLoc}</if>
<if test="checkStatus != null and checkStatus != ''">and qct.check_status = #{checkStatus}</if>

@ -46,6 +46,7 @@
<result property="confirmTime" column="confirm_time"/>
<result property="workorderCodeSap" column="workorderCodeSap"/>
<result property="cpkType" column="cpk_type"/>
<result property="cpkTypeName" column="cpkTypeName"/>
</resultMap>
@ -108,12 +109,13 @@
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status,
qct.check_man_code, qct.check_man_name,qct.check_time, qct.check_result, qct.status,
qct.create_by,qct.create_time, qct.update_by, qct.update_time,
qct.check_type,qct.sample_quality,qct.noOk_quality,bpa.cpk_type,
qct.check_type,qct.sample_quality,qct.noOk_quality,bpa.cpk_type,sdd.dict_label cpkTypeName,
q.type_code,q.check_name,SUBSTRING(pow.workorder_code_sap, 4, 12) workorderCodeSap
from qc_check_task qct
left join qc_check_type q on q.id = qct.check_type
left join pro_order_workorder pow on pow.workorder_code = qct.order_no
left join base_product_attached bpa on concat('0000000',bpa.product_code) = qct.material_code
left join lanju_op_cloud.dbo.sys_dict_data sdd on sdd.dict_type = 'qms_category' and sdd.dict_value = bpa.cpk_type
<where>
<if test="checkNo != null and checkNo != ''">and qct.check_no = #{checkNo}</if>
<if test="incomeBatchNo != null and incomeBatchNo != ''">and qct.income_batch_no = #{incomeBatchNo}</if>

@ -206,7 +206,9 @@
left join base_equipment be on be.equipment_code = qct.check_loc
where qct.check_type = 'checkTypeSCXJ' and qct.del_flag = '0' and pow.del_flag = '0'
<if test="orderNo != null ">and qct.check_no like concat('%',#{orderNo},'%')</if>
<if test="materialCode != null ">and qct.material_code like concat('%',#{materialCode},'%')</if>
<if test="materialCode != null ">and (
qct.material_code like concat('%',#{materialCode},'%') or qct.material_name like concat('%',#{materialCode},'%')
)</if>
<if test="incomeBatchNo != null ">and qct.income_batch_no like concat('%',#{incomeBatchNo},'%')</if>
<if test="incomeTimeStr != null ">and CONVERT(varchar(10),pow.product_date, 120) = #{incomeTimeStr}</if>
<if test="incomeTimeStart != null ">and CONVERT(varchar(30),qct.income_time, 120) >= #{incomeTimeStart}</if>

@ -66,6 +66,9 @@ public class SapController extends BaseController {
@Autowired
private SapWmsService sapWmsService;
@Autowired
private SapDeviceService sapDeviceService;
@Resource
private DynamicDatasourceCreator dynamicDatasourceCreator;
@Resource
@ -522,6 +525,13 @@ public class SapController extends BaseController {
return sapItemSyncService.sap105temporarilyCollected(mapList);
}
/*******************设备*****************/
@PostMapping("/sapZmesAnlaGet")
@Log(title = "设备同步接口", businessType = BusinessType.SAP)
public R sapZmesAnlaGet(@RequestBody(required = false) Map paramMap) {
return sapDeviceService.sapZmesAnlaGet(paramMap);
}
@PostMapping("/addDatasource")
public R addDatasource(@RequestBody DataSourcePropertyDTO dto){
DataSourceProperty dataSourceProperty = new DataSourceProperty();
@ -538,5 +548,11 @@ public class SapController extends BaseController {
return R.ok();
}
//白坯的未清采购订单数量 ZMES_PURWQ_GET
@PostMapping("/ZmesPurwqGet")
@Log(title = "白坯的未清采购订单数量", businessType = BusinessType.SAP)
public R ZmesPurwqGet(@RequestBody(required = false) Map paramMap) {
return sapItemSyncService.ZmesPurwqGet(paramMap);
}
}

@ -0,0 +1,60 @@
package com.op.sap.domain.vo;
import java.util.Date;
public class SapWBDemand {
private String werks;///工厂
private String matnr;//物料号
private String maktx;//物料描述
private Double menge;//数量
private String meins;//单位
private Date bedat;//最早的采购订单日期
public String getWerks() {
return werks;
}
public void setWerks(String werks) {
this.werks = werks;
}
public String getMatnr() {
return matnr;
}
public void setMatnr(String matnr) {
this.matnr = matnr;
}
public String getMaktx() {
return maktx;
}
public void setMaktx(String maktx) {
this.maktx = maktx;
}
public Double getMenge() {
return menge;
}
public void setMenge(Double menge) {
this.menge = menge;
}
public String getMeins() {
return meins;
}
public void setMeins(String meins) {
this.meins = meins;
}
public Date getBedat() {
return bedat;
}
public void setBedat(Date bedat) {
this.bedat = bedat;
}
}

@ -0,0 +1,8 @@
package com.op.sap.mapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SapDeviceMapper {
}

@ -0,0 +1,10 @@
package com.op.sap.service;
import com.op.common.core.domain.R;
import java.util.Map;
public interface SapDeviceService {
R sapZmesAnlaGet(Map paramMap);
}

@ -40,4 +40,6 @@ public interface SapItemSyncService {
R temporarilyCollected(List<Map> mapList);
R sap105temporarilyCollected(List<Map> mapList);
R ZmesPurwqGet(Map paramMap);
}

@ -0,0 +1,72 @@
package com.op.sap.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.op.common.core.constant.Constants;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.sap.mapper.SapDeviceMapper;
import com.op.sap.service.SapDeviceService;
import com.op.system.api.domain.quality.QcCheckTaskIncomeDTO;
import com.sap.conn.jco.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import javax.validation.Validator;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Component
@Service
public class SapDeviceServiceImpl implements SapDeviceService {
@Autowired
private SapDeviceMapper sapDeviceMapper;
@Autowired
protected Validator validator;
@Autowired
private JCoDestination dest;
private static final Logger log = LoggerFactory.getLogger(SapItemSyncImpl.class);
@Override
public R sapZmesAnlaGet(Map paramMap) {
try {
JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZMES_ANLA_GET");
if (func == null) {
throw new RuntimeException("Function does not exist in SAP");
}
log.info("设备同步参数-------" + paramMap.toString());
//参数
JCoParameterList jCoParameterList = func.getImportParameterList();
jCoParameterList.setValue("P_SERNR", paramMap.get("P_SERNR"));
func.execute(dest);//执行调用函数
JCoTable maraTable = func.getTableParameterList().getTable("L_ANLA");
for (int i = 0; i < maraTable.getNumRows(); i++) {
maraTable.setRow(i);
String BUKRS = maraTable.getString("BUKRS");
String ANLN1 = maraTable.getString("ANLN1");
String ANLN2 = maraTable.getString("ANLN2");
String TXT50 = maraTable.getString("TXT50");
String SERNR = maraTable.getString("SERNR");
String INVZU = maraTable.getString("INVZU");
System.out.println("公司代码"+BUKRS+"主资产号"+ANLN1+"资产次级编号"+ANLN2+"资产描述"+TXT50+"序列号"+SERNR+"补充库存说明"+INVZU);
}
return R.ok();
} catch (Exception e) {
log.error(e.getMessage());
return R.fail(e.getMessage());
}
}
}

@ -10,6 +10,7 @@ import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.bean.BeanValidators;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.sap.domain.vo.SapWBDemand;
import com.op.system.api.domain.quality.QcCheckTaskIncomeDTO;
import com.op.system.api.domain.sap.SapBackflushMPQuery;
import com.op.sap.domain.vo.SapItemQuery;
@ -208,7 +209,7 @@ public class SapItemSyncImpl implements SapItemSyncService {
baseProduct.setUpdateBy(SecurityUtils.getUsername());
sapBaseProductList.add(baseProduct);
}
//this.importProducts(sapBaseProductList)
return R.ok(this.importProducts(sapBaseProductList,sapItemQuery.getWerks()));
} catch (Exception e) {
return R.fail(e.getMessage());
@ -809,5 +810,51 @@ public class SapItemSyncImpl implements SapItemSyncService {
}
}
@Override
public R ZmesPurwqGet(Map paramMap) {
try {
JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZMES_PURWQ_GET");
if (func == null) {
throw new RuntimeException("Function does not exist in SAP");
}
log.info("白坯的未清采购订单数量-------" + paramMap.toString());
//参数
JCoParameterList jCoParameterList = func.getImportParameterList();
jCoParameterList.setValue("P_WERKS", paramMap.get("werks"));
func.execute(dest);//执行调用函数
JCoTable maraTable = func.getTableParameterList().getTable("LT_PURWQ");
String RETCODE = func.getExportParameterList().getString("RETCODE");
String RETMSG = func.getExportParameterList().getString("RETMSG");
List<SapWBDemand> sapWBDemandList=new ArrayList<>();
if(Constants.LOGIN_SUCCESS_STATUS.equals(RETCODE)){
for (int i = 0; i < maraTable.getNumRows(); i++) {
maraTable.setRow(i);
SapWBDemand sapWBDemand=new SapWBDemand();
String WERKS = maraTable.getString("WERKS");///工厂
String MATNR = maraTable.getString("MATNR");//物料号
String MAKTX = maraTable.getString("MAKTX");//物料描述
Double MENGE = maraTable.getDouble("MENGE");//数量
String MEINS = maraTable.getString("MEINS");//单位
Date BEDAT = maraTable.getDate("BEDAT");//最早的采购订单日期
sapWBDemand.setWerks(WERKS);
sapWBDemand.setMatnr(MATNR);
sapWBDemand.setMaktx(MAKTX);
sapWBDemand.setMenge(MENGE);
sapWBDemand.setMeins(MEINS);
sapWBDemand.setBedat(BEDAT);
sapWBDemandList.add(sapWBDemand);
}
return R.ok(sapWBDemandList,RETMSG);
}else {
return R.fail(RETMSG);
}
} catch (Exception e) {
log.error(e.getMessage());
return R.fail(e.getMessage());
}
}
}

@ -0,0 +1,104 @@
package com.op.wms.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
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.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.log.enums.BusinessType;
import com.op.wms.domain.BpRawMaterialIn;
import com.op.wms.service.IBpRawMaterialInService;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2024-10-28
*/
@RestController
@RequestMapping("/raw")
public class BpRawMaterialInController extends BaseController
{
@Autowired
private IBpRawMaterialInService bpRawMaterialInService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('wms:raw:list')")
@GetMapping("/list")
public TableDataInfo list(BpRawMaterialIn bpRawMaterialIn)
{
startPage();
List<BpRawMaterialIn> list = bpRawMaterialInService.selectBpRawMaterialInList(bpRawMaterialIn);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('wms:raw:export')")
@Log(title = "白坯原材料入库", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BpRawMaterialIn bpRawMaterialIn)
{
List<BpRawMaterialIn> list = bpRawMaterialInService.selectBpRawMaterialInList(bpRawMaterialIn);
ExcelUtil<BpRawMaterialIn> util = new ExcelUtil<BpRawMaterialIn>(BpRawMaterialIn.class);
util.exportExcel(response, list, "白坯原材料入库数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('wms:raw:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(bpRawMaterialInService.selectBpRawMaterialInById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('wms:raw:add')")
@Log(title = "白坯原材料入库", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BpRawMaterialIn bpRawMaterialIn)
{
return toAjax(bpRawMaterialInService.insertBpRawMaterialIn(bpRawMaterialIn));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('wms:raw:edit')")
@Log(title = "白坯原材料入库", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BpRawMaterialIn bpRawMaterialIn)
{
return toAjax(bpRawMaterialInService.updateBpRawMaterialIn(bpRawMaterialIn));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('wms:raw:remove')")
@Log(title = "白坯原材料入库", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(bpRawMaterialInService.deleteBpRawMaterialInByIds(ids));
}
}

@ -0,0 +1,105 @@
package com.op.wms.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.microsoft.windowsazure.exception.ServiceException;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.op.common.log.annotation.Log;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.log.enums.BusinessType;
import com.op.wms.domain.BpRawMaterialInDetail;
import com.op.wms.service.IBpRawMaterialInDetailService;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2024-10-29
*/
@RestController
@RequestMapping("/detail")
public class BpRawMaterialInDetailController extends BaseController
{
@Autowired
private IBpRawMaterialInDetailService bpRawMaterialInDetailService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('wms:detail:list')")
@GetMapping("/list")
public TableDataInfo list(BpRawMaterialInDetail bpRawMaterialInDetail)
{
startPage();
List<BpRawMaterialInDetail> list = bpRawMaterialInDetailService.selectBpRawMaterialInDetailList(bpRawMaterialInDetail);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('wms:detail:export')")
@Log(title = "白坯原材料入库明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BpRawMaterialInDetail bpRawMaterialInDetail)
{
List<BpRawMaterialInDetail> list = bpRawMaterialInDetailService.selectBpRawMaterialInDetailList(bpRawMaterialInDetail);
ExcelUtil<BpRawMaterialInDetail> util = new ExcelUtil<BpRawMaterialInDetail>(BpRawMaterialInDetail.class);
util.exportExcel(response, list, "白坯原材料入库明细数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('wms:detail:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(bpRawMaterialInDetailService.selectBpRawMaterialInDetailById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('wms:detail:add')")
@Log(title = "白坯原材料入库明细", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BpRawMaterialInDetail bpRawMaterialInDetail) throws ServiceException {
return toAjax(bpRawMaterialInDetailService.insertBpRawMaterialInDetail(bpRawMaterialInDetail));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('wms:detail:edit')")
@Log(title = "白坯原材料入库明细", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BpRawMaterialInDetail bpRawMaterialInDetail)
{
return toAjax(bpRawMaterialInDetailService.updateBpRawMaterialInDetail(bpRawMaterialInDetail));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('wms:detail:remove')")
@Log(title = "白坯原材料入库明细", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(bpRawMaterialInDetailService.deleteBpRawMaterialInDetailByIds(ids));
}
}

@ -0,0 +1,280 @@
package com.op.wms.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
/**
* bp_raw_material_in
*
* @author ruoyi
* @date 2024-10-28
*/
public class BpRawMaterialIn extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private String id;
/** 工厂 */
@Excel(name = "工厂")
private String factoryCode;
/** 仓库 */
@Excel(name = "仓库")
private String waCode;
/** 库区 */
@Excel(name = "库区")
private String wlCode;
/** 物料编码 */
@Excel(name = "物料编码")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 单位 */
@Excel(name = "单位")
private String unit;
/** 供应商 */
@Excel(name = "供应商")
private String supplyName;
/** 计划数量 */
@Excel(name = "计划数量")
private Long amnountPlan;
/** 收货数量 */
@Excel(name = "收货数量")
private Long amountReal;
/** 备用 */
@Excel(name = "备用")
private String userDefined1;
/** 备用 */
@Excel(name = "备用")
private String userDefined2;
/** 备用 */
@Excel(name = "备用")
private String userDefined3;
/** 备用 */
@Excel(name = "备用")
private String userDefined4;
/** 备用 */
@Excel(name = "备用")
private String userDefined5;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date gmtCreate;
/** 更新人 */
@Excel(name = "更新人")
private String modifiedBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date gmtModified;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setFactoryCode(String factoryCode)
{
this.factoryCode = factoryCode;
}
public String getFactoryCode()
{
return factoryCode;
}
public void setWaCode(String waCode)
{
this.waCode = waCode;
}
public String getWaCode()
{
return waCode;
}
public void setWlCode(String wlCode)
{
this.wlCode = wlCode;
}
public String getWlCode()
{
return wlCode;
}
public void setMaterialCode(String materialCode)
{
this.materialCode = materialCode;
}
public String getMaterialCode()
{
return materialCode;
}
public void setMaterialName(String materialName)
{
this.materialName = materialName;
}
public String getMaterialName()
{
return materialName;
}
public void setUnit(String unit)
{
this.unit = unit;
}
public String getUnit()
{
return unit;
}
public void setSupplyName(String supplyName)
{
this.supplyName = supplyName;
}
public String getSupplyName()
{
return supplyName;
}
public void setAmnountPlan(Long amnountPlan)
{
this.amnountPlan = amnountPlan;
}
public Long getAmnountPlan()
{
return amnountPlan;
}
public void setAmountReal(Long amountReal)
{
this.amountReal = amountReal;
}
public Long getAmountReal()
{
return amountReal;
}
public void setUserDefined1(String userDefined1)
{
this.userDefined1 = userDefined1;
}
public String getUserDefined1()
{
return userDefined1;
}
public void setUserDefined2(String userDefined2)
{
this.userDefined2 = userDefined2;
}
public String getUserDefined2()
{
return userDefined2;
}
public void setUserDefined3(String userDefined3)
{
this.userDefined3 = userDefined3;
}
public String getUserDefined3()
{
return userDefined3;
}
public void setUserDefined4(String userDefined4)
{
this.userDefined4 = userDefined4;
}
public String getUserDefined4()
{
return userDefined4;
}
public void setUserDefined5(String userDefined5)
{
this.userDefined5 = userDefined5;
}
public String getUserDefined5()
{
return userDefined5;
}
public void setGmtCreate(Date gmtCreate)
{
this.gmtCreate = gmtCreate;
}
public Date getGmtCreate()
{
return gmtCreate;
}
public void setModifiedBy(String modifiedBy)
{
this.modifiedBy = modifiedBy;
}
public String getModifiedBy()
{
return modifiedBy;
}
public void setGmtModified(Date gmtModified)
{
this.gmtModified = gmtModified;
}
public Date getGmtModified()
{
return gmtModified;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("factoryCode", getFactoryCode())
.append("waCode", getWaCode())
.append("wlCode", getWlCode())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("unit", getUnit())
.append("supplyName", getSupplyName())
.append("amnountPlan", getAmnountPlan())
.append("amountReal", getAmountReal())
.append("userDefined1", getUserDefined1())
.append("userDefined2", getUserDefined2())
.append("userDefined3", getUserDefined3())
.append("userDefined4", getUserDefined4())
.append("userDefined5", getUserDefined5())
.append("createBy", getCreateBy())
.append("gmtCreate", getGmtCreate())
.append("modifiedBy", getModifiedBy())
.append("gmtModified", getGmtModified())
.toString();
}
}

@ -0,0 +1,280 @@
package com.op.wms.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
/**
* bp_raw_material_in_detail
*
* @author ruoyi
* @date 2024-10-29
*/
public class BpRawMaterialInDetail extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private String id;
/** 工厂 */
@Excel(name = "工厂")
private String factoryCode;
/** 仓库 */
@Excel(name = "仓库")
private String waCode;
/** 库区 */
@Excel(name = "库区")
private String wlCode;
/** 物料编码 */
@Excel(name = "物料编码")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 单位 */
@Excel(name = "单位")
private String unit;
/** 供应商 */
@Excel(name = "供应商")
private String supplyName;
/** 计划数量 */
@Excel(name = "计划数量")
private Long amnountPlan;
/** 收货数量 */
@Excel(name = "收货数量")
private Long amountReal;
/** 备用 */
@Excel(name = "备用")
private String userDefined1;
/** 备用 */
@Excel(name = "备用")
private String userDefined2;
/** 备用 */
@Excel(name = "备用")
private String userDefined3;
/** 备用 */
@Excel(name = "备用")
private String userDefined4;
/** 备用 */
@Excel(name = "备用")
private String userDefined5;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date gmtCreate;
/** 更新人 */
@Excel(name = "更新人")
private String modifiedBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date gmtModified;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setFactoryCode(String factoryCode)
{
this.factoryCode = factoryCode;
}
public String getFactoryCode()
{
return factoryCode;
}
public void setWaCode(String waCode)
{
this.waCode = waCode;
}
public String getWaCode()
{
return waCode;
}
public void setWlCode(String wlCode)
{
this.wlCode = wlCode;
}
public String getWlCode()
{
return wlCode;
}
public void setMaterialCode(String materialCode)
{
this.materialCode = materialCode;
}
public String getMaterialCode()
{
return materialCode;
}
public void setMaterialName(String materialName)
{
this.materialName = materialName;
}
public String getMaterialName()
{
return materialName;
}
public void setUnit(String unit)
{
this.unit = unit;
}
public String getUnit()
{
return unit;
}
public void setSupplyName(String supplyName)
{
this.supplyName = supplyName;
}
public String getSupplyName()
{
return supplyName;
}
public void setAmnountPlan(Long amnountPlan)
{
this.amnountPlan = amnountPlan;
}
public Long getAmnountPlan()
{
return amnountPlan;
}
public void setAmountReal(Long amountReal)
{
this.amountReal = amountReal;
}
public Long getAmountReal()
{
return amountReal;
}
public void setUserDefined1(String userDefined1)
{
this.userDefined1 = userDefined1;
}
public String getUserDefined1()
{
return userDefined1;
}
public void setUserDefined2(String userDefined2)
{
this.userDefined2 = userDefined2;
}
public String getUserDefined2()
{
return userDefined2;
}
public void setUserDefined3(String userDefined3)
{
this.userDefined3 = userDefined3;
}
public String getUserDefined3()
{
return userDefined3;
}
public void setUserDefined4(String userDefined4)
{
this.userDefined4 = userDefined4;
}
public String getUserDefined4()
{
return userDefined4;
}
public void setUserDefined5(String userDefined5)
{
this.userDefined5 = userDefined5;
}
public String getUserDefined5()
{
return userDefined5;
}
public void setGmtCreate(Date gmtCreate)
{
this.gmtCreate = gmtCreate;
}
public Date getGmtCreate()
{
return gmtCreate;
}
public void setModifiedBy(String modifiedBy)
{
this.modifiedBy = modifiedBy;
}
public String getModifiedBy()
{
return modifiedBy;
}
public void setGmtModified(Date gmtModified)
{
this.gmtModified = gmtModified;
}
public Date getGmtModified()
{
return gmtModified;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("factoryCode", getFactoryCode())
.append("waCode", getWaCode())
.append("wlCode", getWlCode())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("unit", getUnit())
.append("supplyName", getSupplyName())
.append("amnountPlan", getAmnountPlan())
.append("amountReal", getAmountReal())
.append("userDefined1", getUserDefined1())
.append("userDefined2", getUserDefined2())
.append("userDefined3", getUserDefined3())
.append("userDefined4", getUserDefined4())
.append("userDefined5", getUserDefined5())
.append("createBy", getCreateBy())
.append("gmtCreate", getGmtCreate())
.append("modifiedBy", getModifiedBy())
.append("gmtModified", getGmtModified())
.toString();
}
}

@ -64,4 +64,6 @@ public interface BaseProductMapper {
String checkCodeUnique(BaseProduct baseProduct);
BaseProduct selectBaseProductByProductCode(String productCode);
BaseProduct selectBaseProductByProductName(String productName);
}

@ -0,0 +1,61 @@
package com.op.wms.mapper;
import java.util.List;
import com.op.wms.domain.BpRawMaterialInDetail;
/**
* Mapper
*
* @author ruoyi
* @date 2024-10-29
*/
public interface BpRawMaterialInDetailMapper
{
/**
*
*
* @param id
* @return
*/
public BpRawMaterialInDetail selectBpRawMaterialInDetailById(String id);
/**
*
*
* @param bpRawMaterialInDetail
* @return
*/
public List<BpRawMaterialInDetail> selectBpRawMaterialInDetailList(BpRawMaterialInDetail bpRawMaterialInDetail);
/**
*
*
* @param bpRawMaterialInDetail
* @return
*/
public int insertBpRawMaterialInDetail(BpRawMaterialInDetail bpRawMaterialInDetail);
/**
*
*
* @param bpRawMaterialInDetail
* @return
*/
public int updateBpRawMaterialInDetail(BpRawMaterialInDetail bpRawMaterialInDetail);
/**
*
*
* @param id
* @return
*/
public int deleteBpRawMaterialInDetailById(String id);
/**
*
*
* @param ids
* @return
*/
public int deleteBpRawMaterialInDetailByIds(String[] ids);
}

@ -0,0 +1,64 @@
package com.op.wms.mapper;
import java.util.List;
import com.op.wms.domain.BpRawMaterialIn;
/**
* Mapper
*
* @author ruoyi
* @date 2024-10-28
*/
public interface BpRawMaterialInMapper
{
/**
*
*
* @param id
* @return
*/
public BpRawMaterialIn selectBpRawMaterialInById(String id);
/**
*
*
* @param bpRawMaterialIn
* @return
*/
public List<BpRawMaterialIn> selectBpRawMaterialInList(BpRawMaterialIn bpRawMaterialIn);
/**
*
*
* @param bpRawMaterialIn
* @return
*/
public int insertBpRawMaterialIn(BpRawMaterialIn bpRawMaterialIn);
/**
*
*
* @param bpRawMaterialIn
* @return
*/
public int updateBpRawMaterialIn(BpRawMaterialIn bpRawMaterialIn);
/**
*
*
* @param id
* @return
*/
public int deleteBpRawMaterialInById(String id);
/**
*
*
* @param ids
* @return
*/
public int deleteBpRawMaterialInByIds(String[] ids);
BpRawMaterialIn selectBpRawMaterialInBymateriaName(String materiaName);
}

@ -0,0 +1,63 @@
package com.op.wms.service;
import java.util.List;
import com.microsoft.windowsazure.exception.ServiceException;
import com.op.wms.domain.BpRawMaterialInDetail;
/**
* Service
*
* @author ruoyi
* @date 2024-10-29
*/
public interface IBpRawMaterialInDetailService
{
/**
*
*
* @param id
* @return
*/
public BpRawMaterialInDetail selectBpRawMaterialInDetailById(String id);
/**
*
*
* @param bpRawMaterialInDetail
* @return
*/
public List<BpRawMaterialInDetail> selectBpRawMaterialInDetailList(BpRawMaterialInDetail bpRawMaterialInDetail);
/**
*
*
* @param bpRawMaterialInDetail
* @return
*/
public int insertBpRawMaterialInDetail(BpRawMaterialInDetail bpRawMaterialInDetail) throws ServiceException;
/**
*
*
* @param bpRawMaterialInDetail
* @return
*/
public int updateBpRawMaterialInDetail(BpRawMaterialInDetail bpRawMaterialInDetail);
/**
*
*
* @param ids
* @return
*/
public int deleteBpRawMaterialInDetailByIds(String[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteBpRawMaterialInDetailById(String id);
}

@ -0,0 +1,61 @@
package com.op.wms.service;
import java.util.List;
import com.op.wms.domain.BpRawMaterialIn;
/**
* Service
*
* @author ruoyi
* @date 2024-10-28
*/
public interface IBpRawMaterialInService
{
/**
*
*
* @param id
* @return
*/
public BpRawMaterialIn selectBpRawMaterialInById(String id);
/**
*
*
* @param bpRawMaterialIn
* @return
*/
public List<BpRawMaterialIn> selectBpRawMaterialInList(BpRawMaterialIn bpRawMaterialIn);
/**
*
*
* @param bpRawMaterialIn
* @return
*/
public int insertBpRawMaterialIn(BpRawMaterialIn bpRawMaterialIn);
/**
*
*
* @param bpRawMaterialIn
* @return
*/
public int updateBpRawMaterialIn(BpRawMaterialIn bpRawMaterialIn);
/**
*
*
* @param ids
* @return
*/
public int deleteBpRawMaterialInByIds(String[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteBpRawMaterialInById(String id);
}

@ -0,0 +1,156 @@
package com.op.wms.service.impl;
import java.util.Date;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.microsoft.windowsazure.exception.ServiceException;
import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.wms.domain.BaseProduct;
import com.op.wms.domain.BpRawMaterialIn;
import com.op.wms.mapper.BaseProductMapper;
import com.op.wms.mapper.BpRawMaterialInMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.wms.mapper.BpRawMaterialInDetailMapper;
import com.op.wms.domain.BpRawMaterialInDetail;
import com.op.wms.service.IBpRawMaterialInDetailService;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
* Service
*
* @author ruoyi
* @date 2024-10-29
*/
@Service
public class BpRawMaterialInDetailServiceImpl implements IBpRawMaterialInDetailService
{
@Autowired
private BpRawMaterialInDetailMapper bpRawMaterialInDetailMapper;
@Autowired
private BaseProductMapper baseProductMapper;
@Autowired
private BpRawMaterialInMapper bpRawMaterialInMapper;
/**
*
*
* @param id
* @return
*/
@Override
@DS("#header.poolName")
public BpRawMaterialInDetail selectBpRawMaterialInDetailById(String id)
{
return bpRawMaterialInDetailMapper.selectBpRawMaterialInDetailById(id);
}
/**
*
*
* @param bpRawMaterialInDetail
* @return
*/
@Override
@DS("#header.poolName")
public List<BpRawMaterialInDetail> selectBpRawMaterialInDetailList(BpRawMaterialInDetail bpRawMaterialInDetail)
{
return bpRawMaterialInDetailMapper.selectBpRawMaterialInDetailList(bpRawMaterialInDetail);
}
/**
*
*
* @param bpRawMaterialInDetail
* @return
*/
@Override
@DS("#header.poolName")
public int insertBpRawMaterialInDetail(BpRawMaterialInDetail bpRawMaterialInDetail) throws ServiceException {
//获取当前所选工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
String factoryCode = request.getHeader(key.substring(8)).replace("ds_", "");
if (bpRawMaterialInDetail.getMaterialName().isEmpty() || bpRawMaterialInDetail.getAmountReal()==null){
throw new ServiceException("物料名称或数量不能为空");
}else {
bpRawMaterialInDetail.setId(IdUtils.fastSimpleUUID());
bpRawMaterialInDetail.setFactoryCode(factoryCode);
bpRawMaterialInDetail.setWaCode("白坯原料库");
BaseProduct baseProduct = baseProductMapper.selectBaseProductByProductName(bpRawMaterialInDetail.getMaterialName());
bpRawMaterialInDetail.setMaterialCode(baseProduct.getProductCode());
bpRawMaterialInDetail.setUnit("吨");
bpRawMaterialInDetail.setCreateBy(SecurityContextHolder.getUserName());
bpRawMaterialInDetail.setGmtCreate(new Date());
bpRawMaterialInDetailMapper.insertBpRawMaterialInDetail(bpRawMaterialInDetail);
}
//判断库存中物料是否存在
BpRawMaterialIn bpRawMaterialIn = bpRawMaterialInMapper.selectBpRawMaterialInBymateriaName(bpRawMaterialInDetail.getMaterialName());
if (bpRawMaterialIn==null){
//不存在,添加库存
BpRawMaterialIn bpRawMaterialIn1 = new BpRawMaterialIn();
bpRawMaterialIn1.setId(IdUtils.fastSimpleUUID());
bpRawMaterialIn1.setFactoryCode(factoryCode);
bpRawMaterialIn1.setWaCode("白坯原料库");
bpRawMaterialIn1.setMaterialName(bpRawMaterialInDetail.getMaterialName());
BaseProduct baseProduct = baseProductMapper.selectBaseProductByProductName(bpRawMaterialInDetail.getMaterialName());
bpRawMaterialIn1.setMaterialCode(String.valueOf(baseProduct));
bpRawMaterialIn1.setUnit(bpRawMaterialInDetail.getUnit());
bpRawMaterialIn1.setAmountReal(bpRawMaterialInDetail.getAmountReal());
bpRawMaterialInMapper.insertBpRawMaterialIn(bpRawMaterialIn1);
}else {
//物料存在,加库存
bpRawMaterialIn.getAmountReal();//原有
bpRawMaterialInDetail.getAmountReal();//新增
bpRawMaterialIn.setAmountReal(bpRawMaterialIn.getAmountReal()+bpRawMaterialInDetail.getAmountReal());
bpRawMaterialInMapper.updateBpRawMaterialIn(bpRawMaterialIn);
}
int reselt=1;
return reselt;
}
/**
*
*
* @param bpRawMaterialInDetail
* @return
*/
@Override
@DS("#header.poolName")
public int updateBpRawMaterialInDetail(BpRawMaterialInDetail bpRawMaterialInDetail)
{
return bpRawMaterialInDetailMapper.updateBpRawMaterialInDetail(bpRawMaterialInDetail);
}
/**
*
*
* @param ids
* @return
*/
@Override
@DS("#header.poolName")
public int deleteBpRawMaterialInDetailByIds(String[] ids)
{
return bpRawMaterialInDetailMapper.deleteBpRawMaterialInDetailByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
@DS("#header.poolName")
public int deleteBpRawMaterialInDetailById(String id)
{
return bpRawMaterialInDetailMapper.deleteBpRawMaterialInDetailById(id);
}
}

@ -0,0 +1,101 @@
package com.op.wms.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.wms.domain.BpRawMaterialIn;
import com.op.wms.mapper.BpRawMaterialInMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.wms.service.IBpRawMaterialInService;
/**
* Service
*
* @author ruoyi
* @date 2024-10-28
*/
@Service
public class BpRawMaterialInServiceImpl implements IBpRawMaterialInService
{
@Autowired
private BpRawMaterialInMapper bpRawMaterialInMapper;
/**
*
*
* @param id
* @return
*/
@Override
@DS("#header.poolName")
public BpRawMaterialIn selectBpRawMaterialInById(String id)
{
return bpRawMaterialInMapper.selectBpRawMaterialInById(id);
}
/**
*
*
* @param bpRawMaterialIn
* @return
*/
@Override
@DS("#header.poolName")
public List<BpRawMaterialIn> selectBpRawMaterialInList(BpRawMaterialIn bpRawMaterialIn)
{
return bpRawMaterialInMapper.selectBpRawMaterialInList(bpRawMaterialIn);
}
/**
*
*
* @param bpRawMaterialIn
* @return
*/
@Override
@DS("#header.poolName")
public int insertBpRawMaterialIn(BpRawMaterialIn bpRawMaterialIn)
{
return bpRawMaterialInMapper.insertBpRawMaterialIn(bpRawMaterialIn);
}
/**
*
*
* @param bpRawMaterialIn
* @return
*/
@Override
@DS("#header.poolName")
public int updateBpRawMaterialIn(BpRawMaterialIn bpRawMaterialIn)
{
return bpRawMaterialInMapper.updateBpRawMaterialIn(bpRawMaterialIn);
}
/**
*
*
* @param ids
* @return
*/
@Override
@DS("#header.poolName")
public int deleteBpRawMaterialInByIds(String[] ids)
{
return bpRawMaterialInMapper.deleteBpRawMaterialInByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
@DS("#header.poolName")
public int deleteBpRawMaterialInById(String id)
{
return bpRawMaterialInMapper.deleteBpRawMaterialInById(id);
}
}

@ -472,5 +472,12 @@
where bp.product_code like concat('%', #{productCode}, '%')
and del_flag = '0'
</select>
<select id="selectBaseProductByProductName" parameterType="String" resultMap="BaseProductResult">
select
product_id,
product_code
from base_product
where product_desc_zh = #{productName}
</select>
</mapper>

@ -0,0 +1,142 @@
<?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.wms.mapper.BpRawMaterialInDetailMapper">
<resultMap type="BpRawMaterialInDetail" id="BpRawMaterialInDetailResult">
<result property="id" column="id" />
<result property="factoryCode" column="factory_code" />
<result property="waCode" column="wa_code" />
<result property="wlCode" column="wl_code" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="unit" column="unit" />
<result property="supplyName" column="supply_name" />
<result property="amnountPlan" column="amnount_plan" />
<result property="amountReal" column="amount_real" />
<result property="userDefined1" column="user_defined1" />
<result property="userDefined2" column="user_defined2" />
<result property="userDefined3" column="user_defined3" />
<result property="userDefined4" column="user_defined4" />
<result property="userDefined5" column="user_defined5" />
<result property="createBy" column="create_by" />
<result property="gmtCreate" column="gmt_create" />
<result property="modifiedBy" column="modified_by" />
<result property="gmtModified" column="gmt_modified" />
</resultMap>
<sql id="selectBpRawMaterialInDetailVo">
select id, factory_code, wa_code, wl_code, material_code, material_name, unit, supply_name, amnount_plan, amount_real, user_defined1, user_defined2, user_defined3, user_defined4, user_defined5, create_by, gmt_create, modified_by, gmt_modified from bp_raw_material_in_detail
</sql>
<select id="selectBpRawMaterialInDetailList" parameterType="BpRawMaterialInDetail" resultMap="BpRawMaterialInDetailResult">
<include refid="selectBpRawMaterialInDetailVo"/>
<where>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="waCode != null and waCode != ''"> and wa_code = #{waCode}</if>
<if test="wlCode != null and wlCode != ''"> and wl_code = #{wlCode}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="supplyName != null and supplyName != ''"> and supply_name like concat('%', #{supplyName}, '%')</if>
<if test="amnountPlan != null "> and amnount_plan = #{amnountPlan}</if>
<if test="amountReal != null "> and amount_real = #{amountReal}</if>
<if test="userDefined1 != null and userDefined1 != ''"> and user_defined1 = #{userDefined1}</if>
<if test="userDefined2 != null and userDefined2 != ''"> and user_defined2 = #{userDefined2}</if>
<if test="userDefined3 != null and userDefined3 != ''"> and user_defined3 = #{userDefined3}</if>
<if test="userDefined4 != null and userDefined4 != ''"> and user_defined4 = #{userDefined4}</if>
<if test="userDefined5 != null and userDefined5 != ''"> and user_defined5 = #{userDefined5}</if>
<if test="gmtCreate != null "> and gmt_create = #{gmtCreate}</if>
<if test="modifiedBy != null and modifiedBy != ''"> and modified_by = #{modifiedBy}</if>
<if test="gmtModified != null "> and gmt_modified = #{gmtModified}</if>
</where>
</select>
<select id="selectBpRawMaterialInDetailById" parameterType="String" resultMap="BpRawMaterialInDetailResult">
<include refid="selectBpRawMaterialInDetailVo"/>
where id = #{id}
</select>
<insert id="insertBpRawMaterialInDetail" parameterType="BpRawMaterialInDetail">
insert into bp_raw_material_in_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="waCode != null">wa_code,</if>
<if test="wlCode != null">wl_code,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="unit != null">unit,</if>
<if test="supplyName != null">supply_name,</if>
<if test="amnountPlan != null">amnount_plan,</if>
<if test="amountReal != null">amount_real,</if>
<if test="userDefined1 != null">user_defined1,</if>
<if test="userDefined2 != null">user_defined2,</if>
<if test="userDefined3 != null">user_defined3,</if>
<if test="userDefined4 != null">user_defined4,</if>
<if test="userDefined5 != null">user_defined5,</if>
<if test="createBy != null">create_by,</if>
<if test="gmtCreate != null">gmt_create,</if>
<if test="modifiedBy != null">modified_by,</if>
<if test="gmtModified != null">gmt_modified,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="waCode != null">#{waCode},</if>
<if test="wlCode != null">#{wlCode},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="unit != null">#{unit},</if>
<if test="supplyName != null">#{supplyName},</if>
<if test="amnountPlan != null">#{amnountPlan},</if>
<if test="amountReal != null">#{amountReal},</if>
<if test="userDefined1 != null">#{userDefined1},</if>
<if test="userDefined2 != null">#{userDefined2},</if>
<if test="userDefined3 != null">#{userDefined3},</if>
<if test="userDefined4 != null">#{userDefined4},</if>
<if test="userDefined5 != null">#{userDefined5},</if>
<if test="createBy != null">#{createBy},</if>
<if test="gmtCreate != null">#{gmtCreate},</if>
<if test="modifiedBy != null">#{modifiedBy},</if>
<if test="gmtModified != null">#{gmtModified},</if>
</trim>
</insert>
<update id="updateBpRawMaterialInDetail" parameterType="BpRawMaterialInDetail">
update bp_raw_material_in_detail
<trim prefix="SET" suffixOverrides=",">
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="waCode != null">wa_code = #{waCode},</if>
<if test="wlCode != null">wl_code = #{wlCode},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="supplyName != null">supply_name = #{supplyName},</if>
<if test="amnountPlan != null">amnount_plan = #{amnountPlan},</if>
<if test="amountReal != null">amount_real = #{amountReal},</if>
<if test="userDefined1 != null">user_defined1 = #{userDefined1},</if>
<if test="userDefined2 != null">user_defined2 = #{userDefined2},</if>
<if test="userDefined3 != null">user_defined3 = #{userDefined3},</if>
<if test="userDefined4 != null">user_defined4 = #{userDefined4},</if>
<if test="userDefined5 != null">user_defined5 = #{userDefined5},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="modifiedBy != null">modified_by = #{modifiedBy},</if>
<if test="gmtModified != null">gmt_modified = #{gmtModified},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBpRawMaterialInDetailById" parameterType="String">
delete from bp_raw_material_in_detail where id = #{id}
</delete>
<delete id="deleteBpRawMaterialInDetailByIds" parameterType="String">
delete from bp_raw_material_in_detail where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,148 @@
<?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.wms.mapper.BpRawMaterialInMapper">
<resultMap type="BpRawMaterialIn" id="BpRawMaterialInResult">
<result property="id" column="id" />
<result property="factoryCode" column="factory_code" />
<result property="waCode" column="wa_code" />
<result property="wlCode" column="wl_code" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="unit" column="unit" />
<result property="supplyName" column="supply_name" />
<result property="amnountPlan" column="amnount_plan" />
<result property="amountReal" column="amount_real" />
<result property="userDefined1" column="user_defined1" />
<result property="userDefined2" column="user_defined2" />
<result property="userDefined3" column="user_defined3" />
<result property="userDefined4" column="user_defined4" />
<result property="userDefined5" column="user_defined5" />
<result property="createBy" column="create_by" />
<result property="gmtCreate" column="gmt_create" />
<result property="modifiedBy" column="modified_by" />
<result property="gmtModified" column="gmt_modified" />
</resultMap>
<sql id="selectBpRawMaterialInVo">
select id, factory_code, wa_code, wl_code, material_code, material_name, unit, supply_name, amnount_plan, amount_real, user_defined1, user_defined2, user_defined3, user_defined4, user_defined5, create_by, gmt_create, modified_by, gmt_modified from bp_raw_material_in
</sql>
<select id="selectBpRawMaterialInList" parameterType="BpRawMaterialIn" resultMap="BpRawMaterialInResult">
<include refid="selectBpRawMaterialInVo"/>
<where>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="waCode != null and waCode != ''"> and wa_code = #{waCode}</if>
<if test="wlCode != null and wlCode != ''"> and wl_code = #{wlCode}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="supplyName != null and supplyName != ''"> and supply_name like concat('%', #{supplyName}, '%')</if>
<if test="amnountPlan != null "> and amnount_plan = #{amnountPlan}</if>
<if test="amountReal != null "> and amount_real = #{amountReal}</if>
<if test="userDefined1 != null and userDefined1 != ''"> and user_defined1 = #{userDefined1}</if>
<if test="userDefined2 != null and userDefined2 != ''"> and user_defined2 = #{userDefined2}</if>
<if test="userDefined3 != null and userDefined3 != ''"> and user_defined3 = #{userDefined3}</if>
<if test="userDefined4 != null and userDefined4 != ''"> and user_defined4 = #{userDefined4}</if>
<if test="userDefined5 != null and userDefined5 != ''"> and user_defined5 = #{userDefined5}</if>
<if test="gmtCreate != null "> and gmt_create = #{gmtCreate}</if>
<if test="modifiedBy != null and modifiedBy != ''"> and modified_by = #{modifiedBy}</if>
<if test="gmtModified != null "> and gmt_modified = #{gmtModified}</if>
</where>
</select>
<select id="selectBpRawMaterialInById" parameterType="String" resultMap="BpRawMaterialInResult">
<include refid="selectBpRawMaterialInVo"/>
where id = #{id}
</select>
<select id="selectBpRawMaterialInBymateriaName" resultMap="BpRawMaterialInResult" parameterType="String">
select id, factory_code, wa_code, wl_code, material_code, unit,
supply_name, amnount_plan, amount_real, user_defined1, user_defined2, user_defined3,
user_defined4, user_defined5, create_by, gmt_create, modified_by, gmt_modified
from bp_raw_material_in where material_name = #{materiaName}
</select>
<insert id="insertBpRawMaterialIn" parameterType="BpRawMaterialIn">
insert into bp_raw_material_in
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="waCode != null">wa_code,</if>
<if test="wlCode != null">wl_code,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="unit != null">unit,</if>
<if test="supplyName != null">supply_name,</if>
<if test="amnountPlan != null">amnount_plan,</if>
<if test="amountReal != null">amount_real,</if>
<if test="userDefined1 != null">user_defined1,</if>
<if test="userDefined2 != null">user_defined2,</if>
<if test="userDefined3 != null">user_defined3,</if>
<if test="userDefined4 != null">user_defined4,</if>
<if test="userDefined5 != null">user_defined5,</if>
<if test="createBy != null">create_by,</if>
<if test="gmtCreate != null">gmt_create,</if>
<if test="modifiedBy != null">modified_by,</if>
<if test="gmtModified != null">gmt_modified,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="waCode != null">#{waCode},</if>
<if test="wlCode != null">#{wlCode},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="unit != null">#{unit},</if>
<if test="supplyName != null">#{supplyName},</if>
<if test="amnountPlan != null">#{amnountPlan},</if>
<if test="amountReal != null">#{amountReal},</if>
<if test="userDefined1 != null">#{userDefined1},</if>
<if test="userDefined2 != null">#{userDefined2},</if>
<if test="userDefined3 != null">#{userDefined3},</if>
<if test="userDefined4 != null">#{userDefined4},</if>
<if test="userDefined5 != null">#{userDefined5},</if>
<if test="createBy != null">#{createBy},</if>
<if test="gmtCreate != null">#{gmtCreate},</if>
<if test="modifiedBy != null">#{modifiedBy},</if>
<if test="gmtModified != null">#{gmtModified},</if>
</trim>
</insert>
<update id="updateBpRawMaterialIn" parameterType="BpRawMaterialIn">
update bp_raw_material_in
<trim prefix="SET" suffixOverrides=",">
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="waCode != null">wa_code = #{waCode},</if>
<if test="wlCode != null">wl_code = #{wlCode},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="supplyName != null">supply_name = #{supplyName},</if>
<if test="amnountPlan != null">amnount_plan = #{amnountPlan},</if>
<if test="amountReal != null">amount_real = #{amountReal},</if>
<if test="userDefined1 != null">user_defined1 = #{userDefined1},</if>
<if test="userDefined2 != null">user_defined2 = #{userDefined2},</if>
<if test="userDefined3 != null">user_defined3 = #{userDefined3},</if>
<if test="userDefined4 != null">user_defined4 = #{userDefined4},</if>
<if test="userDefined5 != null">user_defined5 = #{userDefined5},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="modifiedBy != null">modified_by = #{modifiedBy},</if>
<if test="gmtModified != null">gmt_modified = #{gmtModified},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBpRawMaterialInById" parameterType="String">
delete from bp_raw_material_in where id = #{id}
</delete>
<delete id="deleteBpRawMaterialInByIds" parameterType="String">
delete from bp_raw_material_in where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save