liuxiaoxu
1 month ago
10 changed files with 0 additions and 3302 deletions
@ -1,224 +0,0 @@ |
|||
package com.ruoyi.ck.controller; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.ruoyi.ck.domain.Bom; |
|||
import com.ruoyi.ck.domain.ItemInfo; |
|||
import com.ruoyi.ck.service.IBomService; |
|||
import com.ruoyi.ck.service.impl.ItemCPInfoServiceImpl; |
|||
import com.ruoyi.ck.utils.Result; |
|||
import com.ruoyi.common.annotation.Log; |
|||
import com.ruoyi.common.core.controller.BaseController; |
|||
import com.ruoyi.common.core.domain.AjaxResult; |
|||
import com.ruoyi.common.core.page.TableDataInfo; |
|||
import com.ruoyi.common.enums.BusinessType; |
|||
import com.ruoyi.common.utils.ShiroUtils; |
|||
import com.ruoyi.common.utils.poi.ExcelUtil; |
|||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.ModelMap; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.UnsupportedEncodingException; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 物料清单Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2021-06-21 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/ck/bom") |
|||
public class BomController extends BaseController { |
|||
private String prefix = "ck/bom"; |
|||
|
|||
@Autowired |
|||
private IBomService bomService; |
|||
|
|||
@Autowired |
|||
private ItemCPInfoServiceImpl itemCPInfoService; |
|||
|
|||
@RequiresPermissions("ck:bom:view") |
|||
@GetMapping() |
|||
public String bom() { |
|||
return prefix + "/bom"; |
|||
} |
|||
|
|||
/** |
|||
* 查询物料清单列表 |
|||
*/ |
|||
@RequiresPermissions("ck:bom:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(Bom bom) { |
|||
//startPage();
|
|||
List<Bom> list = bomService.selectBomListByGroup(bom); |
|||
List<Bom> data = calculateBomHierarchy(list, 1); |
|||
return getDataTable(data); |
|||
} |
|||
|
|||
/** |
|||
* 查询物料清单列表 |
|||
*/ |
|||
@RequiresPermissions("ck:bom:list") |
|||
@PostMapping("/allList") |
|||
@ResponseBody |
|||
public TableDataInfo getList(Bom bom) { |
|||
//System.out.println(bom);
|
|||
startPage(); |
|||
List<Bom> list = bomService.selectBomList(bom); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出物料清单列表 |
|||
*/ |
|||
@RequiresPermissions("ck:bom:export") |
|||
@Log(title = "物料清单", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ResponseBody |
|||
public AjaxResult export(Bom bom) { |
|||
List<Bom> list = bomService.selectBomList(bom); |
|||
ExcelUtil<Bom> util = new ExcelUtil<Bom>(Bom.class); |
|||
return util.exportExcel(list, "物料清单数据"); |
|||
} |
|||
|
|||
/** |
|||
* 导入宿舍列表 |
|||
*/ |
|||
@PostMapping("/importData") |
|||
@ResponseBody |
|||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception |
|||
{ |
|||
ExcelUtil<ItemInfo> util = new ExcelUtil<ItemInfo>(ItemInfo.class); |
|||
List<ItemInfo> userList = util.importExcel(file.getInputStream()); |
|||
String operName = ShiroUtils.getSysUser().getLoginName(); |
|||
String message = itemCPInfoService.importItem(userList, updateSupport, operName); |
|||
return AjaxResult.success(message); |
|||
} |
|||
/**、 |
|||
* 导出模板 |
|||
*/ |
|||
@GetMapping("/importTemplate") |
|||
@ResponseBody |
|||
public AjaxResult importTemplate() |
|||
{ |
|||
ExcelUtil<ItemInfo> util = new ExcelUtil<ItemInfo>(ItemInfo.class); |
|||
return util.importTemplateExcel("物料模板"); |
|||
} |
|||
|
|||
/** |
|||
* 新增物料清单 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() { |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
// /**
|
|||
// * 新增保存物料清单
|
|||
// */
|
|||
// @RequiresPermissions("ck:bom:add")
|
|||
// @Log(title = "物料清单", businessType = BusinessType.INSERT)
|
|||
// @PostMapping("/add")
|
|||
// @ResponseBody
|
|||
// public AjaxResult addSave(Bom bom)
|
|||
// {
|
|||
// return toAjax(bomService.insertBom(bom));
|
|||
// }
|
|||
|
|||
/** |
|||
* 新增保存物料清单 |
|||
*/ |
|||
@RequiresPermissions("ck:bom:add") |
|||
@Log(title = "物料清单", businessType = BusinessType.INSERT) |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public Result addSave(String jsonStr) throws Exception { |
|||
JSONObject jsonObject = JSONObject.parseObject(jsonStr); |
|||
Bom bom = jsonObject.toJavaObject(Bom.class); |
|||
return bomService.insertBom(bom); |
|||
} |
|||
|
|||
/** |
|||
* 修改物料清单 |
|||
*/ |
|||
@GetMapping("/edit/{versionNo}/{cpCode}") |
|||
public String edit(@PathVariable("versionNo") String versionNo, @PathVariable("cpCode") String cpCode, ModelMap mmap) throws UnsupportedEncodingException { |
|||
Bom bom = new Bom(); |
|||
//String encode = URLEncoder.encode(cpCode, "GBK");
|
|||
bom.setVersionNo(versionNo); |
|||
bom.setCpCode(cpCode); |
|||
//System.out.println(bom);
|
|||
List<Bom> list = bomService.selectBomList(bom); |
|||
System.out.println(list.size()); |
|||
Bom temp = new Bom(); |
|||
if (list.size() > 0) { |
|||
temp = list.get(0); |
|||
} |
|||
mmap.put("bom", temp); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 查询对应成品的原料清单列表 |
|||
*/ |
|||
@RequiresPermissions("ck:bom:cpyllist") |
|||
@PostMapping("/cpyllist") |
|||
@ResponseBody |
|||
public TableDataInfo cpylList(Bom bom) { |
|||
startPage(); |
|||
List<Bom> list = bomService.selectBomListByCodeVersion(bom); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 修改保存物料清单 |
|||
*/ |
|||
@RequiresPermissions("ck:bom:edit") |
|||
@Log(title = "物料清单", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public Result editSave(String jsonStr) throws Exception{ |
|||
JSONObject jsonObject = JSONObject.parseObject(jsonStr); |
|||
Bom bom = jsonObject.toJavaObject(Bom.class); |
|||
return Result.getSuccessResult(bomService.updateBom(bom)); |
|||
} |
|||
|
|||
/** |
|||
* 删除物料清单 |
|||
*/ |
|||
@RequiresPermissions("ck:bom:remove") |
|||
@Log(title = "物料清单", businessType = BusinessType.DELETE) |
|||
@PostMapping("/removeByCpcode") |
|||
@ResponseBody |
|||
public AjaxResult remove(Bom bom) { |
|||
// System.out.println(bom);
|
|||
return toAjax(bomService.deleteByItem(bom)); |
|||
// return toAjax(1);
|
|||
} |
|||
|
|||
|
|||
//计算bom阶级
|
|||
private List<Bom> calculateBomHierarchy(List<Bom> bomList, int bomClass) { |
|||
List<Bom> finalList = new ArrayList<>(); |
|||
List<Bom> tempList = new ArrayList<>(); |
|||
Bom tempBom = new Bom(); |
|||
for (Bom bom : bomList) { |
|||
bom.setBomHierarchy(bomClass + ""); |
|||
finalList.add(bom); |
|||
tempBom.setCpCode(bom.getWlCode()); |
|||
List<Bom> boms = bomService.selectBomList(tempBom); |
|||
if (boms != null && boms.size() > 0) { |
|||
tempList = calculateBomHierarchy(boms, bomClass + 1); |
|||
} |
|||
} |
|||
finalList.addAll(tempList); |
|||
return finalList; |
|||
} |
|||
|
|||
} |
@ -1,735 +0,0 @@ |
|||
package com.ruoyi.ck.domain; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.ruoyi.common.annotation.Excel; |
|||
import com.ruoyi.common.core.domain.BaseEntity; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 物料清单对象 bom |
|||
* |
|||
* @author ruoyi |
|||
* @date 2021-06-21 |
|||
*/ |
|||
public class Bom extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String versionNo; |
|||
|
|||
/** 成品编号 */ |
|||
@Excel(name = "成品编号") |
|||
private String cpCode; |
|||
|
|||
/** 成品名称 */ |
|||
@Excel(name = "成品名称") |
|||
private String cpName; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String cpType; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String cpMachineNo; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String cpDw; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String wlCode; |
|||
|
|||
/** 道具名称 */ |
|||
@Excel(name = "道具名称") |
|||
private String itemname; |
|||
|
|||
/** 道具描述 */ |
|||
@Excel(name = "道具描述") |
|||
private String itemstandard; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String stockDw; |
|||
|
|||
/** 使用量 */ |
|||
@Excel(name = "使用量") |
|||
private BigDecimal useNum; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private BigDecimal lostpre; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String zpGuige; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private BigDecimal zpUseNum; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private Long mQty; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String memolist; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private Integer nowversion; |
|||
|
|||
/** */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date begindate; |
|||
|
|||
/** */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date endtime; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String wldm; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String customno; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private Integer sendflag; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private Long YDWDH; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private Long ZLDWDH; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private Long ylWeight; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private Long zongzhongWeight; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String pno; |
|||
|
|||
/** */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date Addtime; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private BigDecimal fuWidth; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String yflItemclass; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String mouldNo; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private Long standNowversion; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private Long comfirmFlag; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String comfirmMan; |
|||
|
|||
/** */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date comfirmDate; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String writeMan; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String GongCha; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String factoryMouldNo; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private Long mainMaterial; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private Long limitFlag; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private BigDecimal gongchaMore; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private BigDecimal gongchaSmall; |
|||
|
|||
/** */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") |
|||
@Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss") |
|||
private Date changtime; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private Long cpNum; |
|||
|
|||
/** */ |
|||
@Excel(name = "") |
|||
private String worklineclass; |
|||
|
|||
private List<Bom> bomList; |
|||
|
|||
private String bomHierarchy; |
|||
|
|||
public String getBomHierarchy() { |
|||
return bomHierarchy; |
|||
} |
|||
|
|||
public void setBomHierarchy(String bomHierarchy) { |
|||
this.bomHierarchy = bomHierarchy; |
|||
} |
|||
|
|||
public List<Bom> getBomList() { |
|||
return bomList; |
|||
} |
|||
|
|||
public void setBomList(List<Bom> bomList) { |
|||
this.bomList = bomList; |
|||
} |
|||
|
|||
public void setVersionNo(String versionNo) |
|||
{ |
|||
this.versionNo = versionNo; |
|||
} |
|||
|
|||
public String getVersionNo() |
|||
{ |
|||
return versionNo; |
|||
} |
|||
public void setCpCode(String cpCode) |
|||
{ |
|||
this.cpCode = cpCode; |
|||
} |
|||
|
|||
public String getCpCode() |
|||
{ |
|||
return cpCode; |
|||
} |
|||
public void setCpName(String cpName) |
|||
{ |
|||
this.cpName = cpName; |
|||
} |
|||
|
|||
public String getCpName() |
|||
{ |
|||
return cpName; |
|||
} |
|||
public void setCpType(String cpType) |
|||
{ |
|||
this.cpType = cpType; |
|||
} |
|||
|
|||
public String getCpType() |
|||
{ |
|||
return cpType; |
|||
} |
|||
public void setCpMachineNo(String cpMachineNo) |
|||
{ |
|||
this.cpMachineNo = cpMachineNo; |
|||
} |
|||
|
|||
public String getCpMachineNo() |
|||
{ |
|||
return cpMachineNo; |
|||
} |
|||
public void setCpDw(String cpDw) |
|||
{ |
|||
this.cpDw = cpDw; |
|||
} |
|||
|
|||
public String getCpDw() |
|||
{ |
|||
return cpDw; |
|||
} |
|||
public void setWlCode(String wlCode) |
|||
{ |
|||
this.wlCode = wlCode; |
|||
} |
|||
|
|||
public String getWlCode() |
|||
{ |
|||
return wlCode; |
|||
} |
|||
|
|||
public String getItemname() { |
|||
return itemname; |
|||
} |
|||
|
|||
public void setItemname(String itemname) { |
|||
this.itemname = itemname; |
|||
} |
|||
|
|||
public String getItemstandard() { |
|||
return itemstandard; |
|||
} |
|||
|
|||
public void setItemstandard(String itemstandard) { |
|||
this.itemstandard = itemstandard; |
|||
} |
|||
|
|||
public void setStockDw(String stockDw) |
|||
{ |
|||
this.stockDw = stockDw; |
|||
} |
|||
|
|||
public String getStockDw() |
|||
{ |
|||
return stockDw; |
|||
} |
|||
public void setUseNum(BigDecimal useNum) |
|||
{ |
|||
this.useNum = useNum; |
|||
} |
|||
|
|||
public BigDecimal getUseNum() |
|||
{ |
|||
return useNum; |
|||
} |
|||
public void setLostpre(BigDecimal lostpre) |
|||
{ |
|||
this.lostpre = lostpre; |
|||
} |
|||
|
|||
public BigDecimal getLostpre() |
|||
{ |
|||
return lostpre; |
|||
} |
|||
public void setZpGuige(String zpGuige) |
|||
{ |
|||
this.zpGuige = zpGuige; |
|||
} |
|||
|
|||
public String getZpGuige() |
|||
{ |
|||
return zpGuige; |
|||
} |
|||
public void setZpUseNum(BigDecimal zpUseNum) |
|||
{ |
|||
this.zpUseNum = zpUseNum; |
|||
} |
|||
|
|||
public BigDecimal getZpUseNum() |
|||
{ |
|||
return zpUseNum; |
|||
} |
|||
public void setmQty(Long mQty) |
|||
{ |
|||
this.mQty = mQty; |
|||
} |
|||
|
|||
public Long getmQty() |
|||
{ |
|||
return mQty; |
|||
} |
|||
public void setMemolist(String memolist) |
|||
{ |
|||
this.memolist = memolist; |
|||
} |
|||
|
|||
public String getMemolist() |
|||
{ |
|||
return memolist; |
|||
} |
|||
public void setNowversion(Integer nowversion) |
|||
{ |
|||
this.nowversion = nowversion; |
|||
} |
|||
|
|||
public Integer getNowversion() |
|||
{ |
|||
return nowversion; |
|||
} |
|||
public void setBegindate(Date begindate) |
|||
{ |
|||
this.begindate = begindate; |
|||
} |
|||
|
|||
public Date getBegindate() |
|||
{ |
|||
return begindate; |
|||
} |
|||
public void setEndtime(Date endtime) |
|||
{ |
|||
this.endtime = endtime; |
|||
} |
|||
|
|||
public Date getEndtime() |
|||
{ |
|||
return endtime; |
|||
} |
|||
public void setWldm(String wldm) |
|||
{ |
|||
this.wldm = wldm; |
|||
} |
|||
|
|||
public String getWldm() |
|||
{ |
|||
return wldm; |
|||
} |
|||
public void setCustomno(String customno) |
|||
{ |
|||
this.customno = customno; |
|||
} |
|||
|
|||
public String getCustomno() |
|||
{ |
|||
return customno; |
|||
} |
|||
public void setSendflag(Integer sendflag) |
|||
{ |
|||
this.sendflag = sendflag; |
|||
} |
|||
|
|||
public Integer getSendflag() |
|||
{ |
|||
return sendflag; |
|||
} |
|||
public void setYDWDH(Long YDWDH) |
|||
{ |
|||
this.YDWDH = YDWDH; |
|||
} |
|||
|
|||
public Long getYDWDH() |
|||
{ |
|||
return YDWDH; |
|||
} |
|||
public void setZLDWDH(Long ZLDWDH) |
|||
{ |
|||
this.ZLDWDH = ZLDWDH; |
|||
} |
|||
|
|||
public Long getZLDWDH() |
|||
{ |
|||
return ZLDWDH; |
|||
} |
|||
public void setYlWeight(Long ylWeight) |
|||
{ |
|||
this.ylWeight = ylWeight; |
|||
} |
|||
|
|||
public Long getYlWeight() |
|||
{ |
|||
return ylWeight; |
|||
} |
|||
public void setZongzhongWeight(Long zongzhongWeight) |
|||
{ |
|||
this.zongzhongWeight = zongzhongWeight; |
|||
} |
|||
|
|||
public Long getZongzhongWeight() |
|||
{ |
|||
return zongzhongWeight; |
|||
} |
|||
public void setPno(String pno) |
|||
{ |
|||
this.pno = pno; |
|||
} |
|||
|
|||
public String getPno() |
|||
{ |
|||
return pno; |
|||
} |
|||
public void setAddtime(Date Addtime) |
|||
{ |
|||
this.Addtime = Addtime; |
|||
} |
|||
|
|||
public Date getAddtime() |
|||
{ |
|||
return Addtime; |
|||
} |
|||
public void setFuWidth(BigDecimal fuWidth) |
|||
{ |
|||
this.fuWidth = fuWidth; |
|||
} |
|||
|
|||
public BigDecimal getFuWidth() |
|||
{ |
|||
return fuWidth; |
|||
} |
|||
public void setYflItemclass(String yflItemclass) |
|||
{ |
|||
this.yflItemclass = yflItemclass; |
|||
} |
|||
|
|||
public String getYflItemclass() |
|||
{ |
|||
return yflItemclass; |
|||
} |
|||
public void setMouldNo(String mouldNo) |
|||
{ |
|||
this.mouldNo = mouldNo; |
|||
} |
|||
|
|||
public String getMouldNo() |
|||
{ |
|||
return mouldNo; |
|||
} |
|||
public void setStandNowversion(Long standNowversion) |
|||
{ |
|||
this.standNowversion = standNowversion; |
|||
} |
|||
|
|||
public Long getStandNowversion() |
|||
{ |
|||
return standNowversion; |
|||
} |
|||
public void setComfirmFlag(Long comfirmFlag) |
|||
{ |
|||
this.comfirmFlag = comfirmFlag; |
|||
} |
|||
|
|||
public Long getComfirmFlag() |
|||
{ |
|||
return comfirmFlag; |
|||
} |
|||
public void setComfirmMan(String comfirmMan) |
|||
{ |
|||
this.comfirmMan = comfirmMan; |
|||
} |
|||
|
|||
public String getComfirmMan() |
|||
{ |
|||
return comfirmMan; |
|||
} |
|||
public void setComfirmDate(Date comfirmDate) |
|||
{ |
|||
this.comfirmDate = comfirmDate; |
|||
} |
|||
|
|||
public Date getComfirmDate() |
|||
{ |
|||
return comfirmDate; |
|||
} |
|||
public void setWriteMan(String writeMan) |
|||
{ |
|||
this.writeMan = writeMan; |
|||
} |
|||
|
|||
public String getWriteMan() |
|||
{ |
|||
return writeMan; |
|||
} |
|||
public void setGongCha(String GongCha) |
|||
{ |
|||
this.GongCha = GongCha; |
|||
} |
|||
|
|||
public String getGongCha() |
|||
{ |
|||
return GongCha; |
|||
} |
|||
public void setFactoryMouldNo(String factoryMouldNo) |
|||
{ |
|||
this.factoryMouldNo = factoryMouldNo; |
|||
} |
|||
|
|||
public String getFactoryMouldNo() |
|||
{ |
|||
return factoryMouldNo; |
|||
} |
|||
public void setMainMaterial(Long mainMaterial) |
|||
{ |
|||
this.mainMaterial = mainMaterial; |
|||
} |
|||
|
|||
public Long getMainMaterial() |
|||
{ |
|||
return mainMaterial; |
|||
} |
|||
public void setLimitFlag(Long limitFlag) |
|||
{ |
|||
this.limitFlag = limitFlag; |
|||
} |
|||
|
|||
public Long getLimitFlag() |
|||
{ |
|||
return limitFlag; |
|||
} |
|||
public void setGongchaMore(BigDecimal gongchaMore) |
|||
{ |
|||
this.gongchaMore = gongchaMore; |
|||
} |
|||
|
|||
public BigDecimal getGongchaMore() |
|||
{ |
|||
return gongchaMore; |
|||
} |
|||
public void setGongchaSmall(BigDecimal gongchaSmall) |
|||
{ |
|||
this.gongchaSmall = gongchaSmall; |
|||
} |
|||
|
|||
public BigDecimal getGongchaSmall() |
|||
{ |
|||
return gongchaSmall; |
|||
} |
|||
public void setChangtime(Date changtime) |
|||
{ |
|||
this.changtime = changtime; |
|||
} |
|||
|
|||
public Date getChangtime() |
|||
{ |
|||
return changtime; |
|||
} |
|||
public void setCpNum(Long cpNum) |
|||
{ |
|||
this.cpNum = cpNum; |
|||
} |
|||
|
|||
public Long getCpNum() |
|||
{ |
|||
return cpNum; |
|||
} |
|||
public void setWorklineclass(String worklineclass) |
|||
{ |
|||
this.worklineclass = worklineclass; |
|||
} |
|||
|
|||
public String getWorklineclass() |
|||
{ |
|||
return worklineclass; |
|||
} |
|||
|
|||
// @Override
|
|||
// public String toString() {
|
|||
// return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|||
// .append("versionNo", getVersionNo())
|
|||
// .append("cpCode", getCpCode())
|
|||
// .append("cpName", getCpName())
|
|||
// .append("cpType", getCpType())
|
|||
// .append("cpMachineNo", getCpMachineNo())
|
|||
// .append("cpDw", getCpDw())
|
|||
// .append("wlCode", getWlCode())
|
|||
// .append("itemname", getItemname())
|
|||
// .append("itemstandard", getItemstandard())
|
|||
// .append("stockDw", getStockDw())
|
|||
// .append("useNum", getUseNum())
|
|||
// .append("lostpre", getLostpre())
|
|||
// .append("zpGuige", getZpGuige())
|
|||
// .append("zpUseNum", getZpUseNum())
|
|||
// .append("mQty", getmQty())
|
|||
// .append("memolist", getMemolist())
|
|||
// .append("nowversion", getNowversion())
|
|||
// .append("begindate", getBegindate())
|
|||
// .append("endtime", getEndtime())
|
|||
// .append("wldm", getWldm())
|
|||
// .append("customno", getCustomno())
|
|||
// .append("sendflag", getSendflag())
|
|||
// .append("YDWDH", getYDWDH())
|
|||
// .append("ZLDWDH", getZLDWDH())
|
|||
// .append("ylWeight", getYlWeight())
|
|||
// .append("zongzhongWeight", getZongzhongWeight())
|
|||
// .append("pno", getPno())
|
|||
// .append("Addtime", getAddtime())
|
|||
// .append("fuWidth", getFuWidth())
|
|||
// .append("yflItemclass", getYflItemclass())
|
|||
// .append("mouldNo", getMouldNo())
|
|||
// .append("standNowversion", getStandNowversion())
|
|||
// .append("comfirmFlag", getComfirmFlag())
|
|||
// .append("comfirmMan", getComfirmMan())
|
|||
// .append("comfirmDate", getComfirmDate())
|
|||
// .append("writeMan", getWriteMan())
|
|||
// .append("GongCha", getGongCha())
|
|||
// .append("factoryMouldNo", getFactoryMouldNo())
|
|||
// .append("mainMaterial", getMainMaterial())
|
|||
// .append("limitFlag", getLimitFlag())
|
|||
// .append("gongchaMore", getGongchaMore())
|
|||
// .append("gongchaSmall", getGongchaSmall())
|
|||
// .append("changtime", getChangtime())
|
|||
// .append("cpNum", getCpNum())
|
|||
// .append("worklineclass", getWorklineclass())
|
|||
// .toString();
|
|||
// }
|
|||
|
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "Bom{" + |
|||
"versionNo='" + versionNo + '\'' + |
|||
", cpCode='" + cpCode + '\'' + |
|||
", cpName='" + cpName + '\'' + |
|||
", cpType='" + cpType + '\'' + |
|||
", cpMachineNo='" + cpMachineNo + '\'' + |
|||
", cpDw='" + cpDw + '\'' + |
|||
", wlCode='" + wlCode + '\'' + |
|||
", itemname='" + itemname + '\'' + |
|||
", itemstandard='" + itemstandard + '\'' + |
|||
", stockDw='" + stockDw + '\'' + |
|||
", useNum=" + useNum + |
|||
", lostpre=" + lostpre + |
|||
", zpGuige='" + zpGuige + '\'' + |
|||
", zpUseNum=" + zpUseNum + |
|||
", mQty=" + mQty + |
|||
", memolist='" + memolist + '\'' + |
|||
", nowversion=" + nowversion + |
|||
", begindate=" + begindate + |
|||
", endtime=" + endtime + |
|||
", wldm='" + wldm + '\'' + |
|||
", customno='" + customno + '\'' + |
|||
", sendflag=" + sendflag + |
|||
", YDWDH=" + YDWDH + |
|||
", ZLDWDH=" + ZLDWDH + |
|||
", ylWeight=" + ylWeight + |
|||
", zongzhongWeight=" + zongzhongWeight + |
|||
", pno='" + pno + '\'' + |
|||
", Addtime=" + Addtime + |
|||
", fuWidth=" + fuWidth + |
|||
", yflItemclass='" + yflItemclass + '\'' + |
|||
", mouldNo='" + mouldNo + '\'' + |
|||
", standNowversion=" + standNowversion + |
|||
", comfirmFlag=" + comfirmFlag + |
|||
", comfirmMan='" + comfirmMan + '\'' + |
|||
", comfirmDate=" + comfirmDate + |
|||
", writeMan='" + writeMan + '\'' + |
|||
", GongCha='" + GongCha + '\'' + |
|||
", factoryMouldNo='" + factoryMouldNo + '\'' + |
|||
", mainMaterial=" + mainMaterial + |
|||
", limitFlag=" + limitFlag + |
|||
", gongchaMore=" + gongchaMore + |
|||
", gongchaSmall=" + gongchaSmall + |
|||
", changtime=" + changtime + |
|||
", cpNum=" + cpNum + |
|||
", worklineclass='" + worklineclass + '\'' + |
|||
", bomList=" + bomList + |
|||
", bomHierarchy='" + bomHierarchy + '\'' + |
|||
'}'; |
|||
} |
|||
} |
@ -1,88 +0,0 @@ |
|||
package com.ruoyi.ck.mapper; |
|||
|
|||
import com.ruoyi.ck.domain.Bom; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 物料清单Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2021-06-21 |
|||
*/ |
|||
public interface BomMapper |
|||
{ |
|||
/** |
|||
* 查询物料清单 |
|||
* |
|||
* @param versionNo 物料清单ID |
|||
* @return 物料清单 |
|||
*/ |
|||
public Bom selectBomById(String versionNo); |
|||
|
|||
/** |
|||
* 查询物料清单列表 |
|||
* |
|||
* @param bom 物料清单 |
|||
* @return 物料清单集合 |
|||
*/ |
|||
public List<Bom> selectBomList(Bom bom); |
|||
|
|||
|
|||
/** |
|||
* 查询物料清单并根据成品代码分组 |
|||
* |
|||
* @param bom 物料清单 |
|||
* @return 物料清单集合 |
|||
*/ |
|||
public List<Bom> selectBomGroupByCPCode(Bom bom); |
|||
|
|||
/** |
|||
* 根据成品代码查询原料 |
|||
* |
|||
* @param bom 物料清单 |
|||
* @return 原料清单集合 |
|||
*/ |
|||
public List<Bom> selectBomListByCodeVersion(Bom bom); |
|||
|
|||
/** |
|||
* 新增物料清单 |
|||
* |
|||
* @param bom 物料清单 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertBom(Bom bom); |
|||
|
|||
/** |
|||
* 修改物料清单 |
|||
* |
|||
* @param bom 物料清单 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateBom(Bom bom); |
|||
|
|||
/** |
|||
* 删除物料清单 |
|||
* |
|||
* @param versionNo 物料清单ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteBomById(String versionNo); |
|||
|
|||
/** |
|||
* 批量删除物料清单 |
|||
* |
|||
* @param versionNos 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteBomByIds(String[] versionNos); |
|||
|
|||
|
|||
/** |
|||
* 删除物料清单 |
|||
* |
|||
* @param bom 需要删除的数据 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteByItem(Bom bom); |
|||
} |
@ -1,88 +0,0 @@ |
|||
package com.ruoyi.ck.service; |
|||
|
|||
import com.ruoyi.ck.domain.Bom; |
|||
import com.ruoyi.ck.utils.Result; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 物料清单Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2021-06-21 |
|||
*/ |
|||
public interface IBomService |
|||
{ |
|||
/** |
|||
* 查询物料清单 |
|||
* |
|||
* @param versionNo 物料清单ID |
|||
* @return 物料清单 |
|||
*/ |
|||
public Bom selectBomById(String versionNo); |
|||
|
|||
/** |
|||
* 查询物料清单列表 |
|||
* |
|||
* @param bom 物料清单 |
|||
* @return 物料清单集合 |
|||
*/ |
|||
public List<Bom> selectBomList(Bom bom); |
|||
|
|||
|
|||
/** |
|||
* 查询物料清单列表分组 |
|||
* |
|||
* @param bom 物料清单 |
|||
* @return 物料清单分组集合 |
|||
*/ |
|||
public List<Bom> selectBomListByGroup(Bom bom); |
|||
|
|||
/** |
|||
* 根据成品代码查询原料 |
|||
* |
|||
* @param bom 物料清单 |
|||
* @return 原料清单集合 |
|||
*/ |
|||
public List<Bom> selectBomListByCodeVersion(Bom bom); |
|||
|
|||
/** |
|||
* 新增物料清单 |
|||
* |
|||
* @param bom 物料清单 |
|||
* @return 结果 |
|||
*/ |
|||
public Result insertBom(Bom bom)throws Exception; |
|||
|
|||
/** |
|||
* 修改物料清单 |
|||
* |
|||
* @param bom 物料清单 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateBom(Bom bom); |
|||
|
|||
/** |
|||
* 批量删除物料清单 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteBomByIds(String ids); |
|||
|
|||
/** |
|||
* 删除物料清单信息 |
|||
* |
|||
* @param versionNo 物料清单ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteBomById(String versionNo); |
|||
|
|||
/** |
|||
* 删除物料清单 |
|||
* |
|||
* @param bom 需要删除的数据 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteByItem(Bom bom); |
|||
} |
@ -1,148 +0,0 @@ |
|||
package com.ruoyi.ck.service.impl; |
|||
|
|||
import com.ruoyi.ck.domain.Bom; |
|||
import com.ruoyi.ck.mapper.BomMapper; |
|||
import com.ruoyi.ck.service.IBomService; |
|||
import com.ruoyi.ck.utils.Result; |
|||
import com.ruoyi.common.core.domain.entity.SysUser; |
|||
import com.ruoyi.common.core.text.Convert; |
|||
import com.ruoyi.common.utils.ShiroUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Calendar; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 物料清单Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2021-06-21 |
|||
*/ |
|||
@Service |
|||
public class BomServiceImpl implements IBomService { |
|||
@Autowired |
|||
private BomMapper bomMapper; |
|||
|
|||
@Autowired |
|||
private ItemCPInfoServiceImpl itemCPInfoServiceImpl; |
|||
|
|||
/** |
|||
* 查询物料清单 |
|||
* |
|||
* @param versionNo 物料清单ID |
|||
* @return 物料清单 |
|||
*/ |
|||
@Override |
|||
public Bom selectBomById(String versionNo) { |
|||
return bomMapper.selectBomById(versionNo); |
|||
} |
|||
|
|||
/** |
|||
* 查询物料清单列表 |
|||
* |
|||
* @param bom 物料清单 |
|||
* @return 物料清单 |
|||
*/ |
|||
@Override |
|||
public List<Bom> selectBomList(Bom bom) { |
|||
return bomMapper.selectBomList(bom); |
|||
} |
|||
|
|||
@Override |
|||
public List<Bom> selectBomListByGroup(Bom bom) { |
|||
return bomMapper.selectBomGroupByCPCode(bom); |
|||
} |
|||
|
|||
@Override |
|||
public List<Bom> selectBomListByCodeVersion(Bom bom) { |
|||
return bomMapper.selectBomListByCodeVersion(bom); |
|||
} |
|||
|
|||
/** |
|||
* 新增物料清单 |
|||
* |
|||
* @param bom 物料清单 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public Result insertBom(Bom bom) throws Exception { |
|||
List<Bom> bomList = bom.getBomList(); |
|||
for (Bom eachBom : bomList) { |
|||
eachBom.setCpCode(bom.getCpCode()); |
|||
eachBom.setCpName(bom.getCpName()); |
|||
eachBom.setVersionNo(bom.getVersionNo()); |
|||
eachBom.setCpType(bom.getCpType()); |
|||
bomMapper.insertBom(eachBom); |
|||
} |
|||
return Result.getSuccessResult(null); |
|||
} |
|||
|
|||
/** |
|||
* 修改物料清单 |
|||
* |
|||
* @param bom 物料清单 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateBom(Bom bom) { |
|||
List<Bom> bomList = bom.getBomList(); |
|||
Bom tempBom = new Bom(); |
|||
tempBom.setCpCode(bom.getCpCode()); |
|||
tempBom.setVersionNo(bom.getVersionNo()); |
|||
List<Bom> boms = bomMapper.selectBomListByCodeVersion(tempBom); |
|||
if (bomList.size() != boms.size()) { |
|||
for (Bom eachFindBom : boms) { |
|||
String eachFindWlCode = eachFindBom.getWlCode(); |
|||
for (Bom eachGetBom : bomList) { |
|||
if (eachFindWlCode.equals(eachGetBom.getWlCode())) { |
|||
break; |
|||
} |
|||
bomMapper.deleteByItem(eachFindBom); |
|||
} |
|||
} |
|||
} |
|||
// 获取当前的用户信息
|
|||
SysUser currentUser = ShiroUtils.getSysUser(); |
|||
// 获取当前的用户名称
|
|||
String userName = currentUser.getUserName(); |
|||
bom.setWriteMan(userName); |
|||
Date time = Calendar.getInstance().getTime(); |
|||
bom.setChangtime(time); |
|||
return bomMapper.updateBom(bom); |
|||
} |
|||
|
|||
/** |
|||
* 删除物料清单对象 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteBomByIds(String ids) { |
|||
return bomMapper.deleteBomByIds(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 删除物料清单信息 |
|||
* |
|||
* @param versionNo 物料清单ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteBomById(String versionNo) { |
|||
return bomMapper.deleteBomById(versionNo); |
|||
} |
|||
|
|||
/** |
|||
* 删除物料清单 |
|||
* |
|||
* @param bom 需要删除的数据 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteByItem(Bom bom) { |
|||
return bomMapper.deleteByItem(bom); |
|||
} |
|||
} |
@ -1,374 +0,0 @@ |
|||
<?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.ruoyi.ck.mapper.BomMapper"> |
|||
|
|||
<resultMap type="Bom" id="BomResult"> |
|||
<result property="versionNo" column="Version_No"/> |
|||
<result property="cpCode" column="CP_CODE"/> |
|||
<result property="cpName" column="CP_NAME"/> |
|||
<result property="cpType" column="CP_TYPE"/> |
|||
<result property="cpMachineNo" column="CP_Machine_NO"/> |
|||
<result property="cpDw" column="CP_DW"/> |
|||
<result property="wlCode" column="Wl_Code"/> |
|||
<result property="itemname" column="Itemname"/> |
|||
<result property="itemstandard" column="Itemstandard"/> |
|||
<result property="stockDw" column="Stock_dw"/> |
|||
<result property="useNum" column="Use_Num"/> |
|||
<result property="lostpre" column="lostpre"/> |
|||
<result property="zpGuige" column="zp_guige"/> |
|||
<result property="zpUseNum" column="zp_use_num"/> |
|||
<result property="mQty" column="m_qty"/> |
|||
<result property="memolist" column="memolist"/> |
|||
<result property="nowversion" column="nowversion"/> |
|||
<result property="begindate" column="begindate"/> |
|||
<result property="endtime" column="endtime"/> |
|||
<result property="wldm" column="wldm"/> |
|||
<result property="customno" column="customno"/> |
|||
<result property="sendflag" column="sendflag"/> |
|||
<result property="YDWDH" column="YDWDH"/> |
|||
<result property="ZLDWDH" column="ZLDWDH"/> |
|||
<result property="ylWeight" column="yl_weight"/> |
|||
<result property="zongzhongWeight" column="zongzhong_Weight"/> |
|||
<result property="pno" column="pno"/> |
|||
<result property="Addtime" column="Addtime"/> |
|||
<result property="fuWidth" column="Fu_Width"/> |
|||
<result property="yflItemclass" column="YFL_ItemClass"/> |
|||
<result property="mouldNo" column="Mould_No"/> |
|||
<result property="standNowversion" column="stand_nowversion"/> |
|||
<result property="comfirmFlag" column="Comfirm_Flag"/> |
|||
<result property="comfirmMan" column="Comfirm_man"/> |
|||
<result property="comfirmDate" column="Comfirm_date"/> |
|||
<result property="writeMan" column="write_man"/> |
|||
<result property="GongCha" column="GongCha"/> |
|||
<result property="factoryMouldNo" column="Factory_Mould_no"/> |
|||
<result property="mainMaterial" column="Main_Material"/> |
|||
<result property="limitFlag" column="Limit_Flag"/> |
|||
<result property="gongchaMore" column="gongcha_more"/> |
|||
<result property="gongchaSmall" column="gongcha_small"/> |
|||
<result property="changtime" column="changtime"/> |
|||
<result property="cpNum" column="CP_NUM"/> |
|||
<result property="worklineclass" column="worklineclass"/> |
|||
</resultMap> |
|||
|
|||
<sql id="selectBomVo"> |
|||
select Version_No, CP_CODE, CP_NAME, CP_TYPE, CP_Machine_NO, CP_DW, Wl_Code, Itemname, Itemstandard, Stock_dw, Use_Num, lostpre, zp_guige, zp_use_num, m_qty, memolist, nowversion, begindate, endtime, wldm, customno, sendflag, YDWDH, ZLDWDH, yl_weight, zongzhong_Weight, pno, Addtime, Fu_Width, YFL_ItemClass, Mould_No, stand_nowversion, Comfirm_Flag, Comfirm_man, Comfirm_date, write_man, GongCha, Factory_Mould_no, Main_Material, Limit_Flag, gongcha_more, gongcha_small, changtime, CP_NUM, worklineclass from bom |
|||
</sql> |
|||
|
|||
<select id="selectBomList" parameterType="Bom" resultMap="BomResult"> |
|||
<include refid="selectBomVo"/> |
|||
<where> |
|||
<if test="versionNo != null and versionNo != ''">and Version_No like concat('%', #{versionNo}, '%')</if> |
|||
<!-- <if test="cpCode != null and cpCode != ''"> and CP_CODE like concat('%', #{cpCode}, '%')</if>--> |
|||
<if test="cpCode != null and cpCode != ''">and CP_CODE = #{cpCode}</if> |
|||
<if test="cpName != null and cpName != ''">and CP_NAME like concat('%', #{cpName}, '%')</if> |
|||
<if test="cpType != null and cpType != ''">and CP_TYPE like concat('%', #{cpType}, '%')</if> |
|||
<if test="cpMachineNo != null and cpMachineNo != ''">and CP_Machine_NO like concat('%', #{cpMachineNo}, |
|||
'%') |
|||
</if> |
|||
<if test="cpDw != null and cpDw != ''">and CP_DW like concat('%', #{cpDw}, '%')</if> |
|||
<if test="wlCode != null and wlCode != ''">and Wl_Code like concat('%', #{wlCode}, '%')</if> |
|||
<if test="itemname != null and itemname != ''">and Itemname like concat('%', #{itemname}, '%')</if> |
|||
<if test="itemstandard != null and itemstandard != ''">and Itemstandard like concat('%', #{itemstandard}, |
|||
'%') |
|||
</if> |
|||
<if test="stockDw != null and stockDw != ''">and Stock_dw like concat('%', #{stockDw}, '%')</if> |
|||
<if test="useNum != null ">and Use_Num like concat('%', #{useNum}, '%')</if> |
|||
<if test="lostpre != null ">and lostpre like concat('%', #{lostpre}, '%')</if> |
|||
<if test="zpGuige != null and zpGuige != ''">and zp_guige like concat('%', #{zpGuige}, '%')</if> |
|||
<if test="zpUseNum != null ">and zp_use_num like concat('%', #{zpUseNum}, '%')</if> |
|||
<if test="mQty != null ">and m_qty like concat('%', #{mQty}, '%')</if> |
|||
<if test="memolist != null and memolist != ''">and memolist like concat('%', #{memolist}, '%')</if> |
|||
<if test="nowversion != null ">and nowversion like concat('%', #{nowversion}, '%')</if> |
|||
<if test="begindate != null ">and begindate like concat('%', #{begindate}, '%')</if> |
|||
<if test="endtime != null ">and endtime like concat('%', #{endtime}, '%')</if> |
|||
<if test="wldm != null and wldm != ''">and wldm like concat('%', #{wldm}, '%')</if> |
|||
<if test="customno != null and customno != ''">and customno like concat('%', #{customno}, '%')</if> |
|||
<if test="sendflag != null ">and sendflag like concat('%', #{sendflag}, '%')</if> |
|||
<if test="YDWDH != null ">and YDWDH like concat('%', #{YDWDH}, '%')</if> |
|||
<if test="ZLDWDH != null ">and ZLDWDH like concat('%', #{ZLDWDH}, '%')</if> |
|||
<if test="ylWeight != null ">and yl_weight like concat('%', #{ylWeight}, '%')</if> |
|||
<if test="zongzhongWeight != null ">and zongzhong_Weight like concat('%', #{zongzhongWeight}, '%')</if> |
|||
<if test="pno != null and pno != ''">and pno like concat('%', #{pno}, '%')</if> |
|||
<if test="Addtime != null ">and Addtime like concat('%', #{Addtime}, '%')</if> |
|||
<if test="fuWidth != null ">and Fu_Width like concat('%', #{fuWidth}, '%')</if> |
|||
<if test="yflItemclass != null and yflItemclass != ''">and YFL_ItemClass like concat('%', #{yflItemclass}, |
|||
'%') |
|||
</if> |
|||
<if test="mouldNo != null and mouldNo != ''">and Mould_No like concat('%', #{mouldNo}, '%')</if> |
|||
<if test="standNowversion != null ">and stand_nowversion like concat('%', #{standNowversion}, '%')</if> |
|||
<if test="comfirmFlag != null ">and Comfirm_Flag like concat('%', #{comfirmFlag}, '%')</if> |
|||
<if test="comfirmMan != null and comfirmMan != ''">and Comfirm_man like concat('%', #{comfirmMan}, '%') |
|||
</if> |
|||
<if test="comfirmDate != null ">and Comfirm_date like concat('%', #{comfirmDate}, '%')</if> |
|||
<if test="writeMan != null and writeMan != ''">and write_man like concat('%', #{writeMan}, '%')</if> |
|||
<if test="GongCha != null and GongCha != ''">and GongCha like concat('%', #{GongCha}, '%')</if> |
|||
<if test="factoryMouldNo != null and factoryMouldNo != ''">and Factory_Mould_no like concat('%', |
|||
#{factoryMouldNo}, '%') |
|||
</if> |
|||
<if test="mainMaterial != null ">and Main_Material like concat('%', #{mainMaterial}, '%')</if> |
|||
<if test="limitFlag != null ">and Limit_Flag like concat('%', #{limitFlag}, '%')</if> |
|||
<if test="gongchaMore != null ">and gongcha_more like concat('%', #{gongchaMore}, '%')</if> |
|||
<if test="gongchaSmall != null ">and gongcha_small like concat('%', #{gongchaSmall}, '%')</if> |
|||
<if test="changtime != null ">and changtime like concat('%', #{changtime}, '%')</if> |
|||
<if test="cpNum != null ">and CP_NUM like concat('%', #{cpNum}, '%')</if> |
|||
<if test="worklineclass != null and worklineclass != ''">and worklineclass like concat('%', |
|||
#{worklineclass}, '%') |
|||
</if> |
|||
</where> |
|||
group by Version_No,CP_CODE |
|||
</select> |
|||
|
|||
<select id="selectBomListByCodeVersion" parameterType="Bom" resultMap="BomResult"> |
|||
<include refid="selectBomVo"/> |
|||
<where> |
|||
<if test="versionNo != null and versionNo != ''">and Version_No = #{versionNo}</if> |
|||
<if test="cpCode != null and cpCode != ''">and CP_CODE = #{cpCode}</if> |
|||
<if test="cpName != null and cpName != ''">and CP_NAME like concat('%', #{cpName}, '%')</if> |
|||
<if test="cpType != null and cpType != ''">and CP_TYPE like concat('%', #{cpType}, '%')</if> |
|||
<if test="cpMachineNo != null and cpMachineNo != ''">and CP_Machine_NO like concat('%', #{cpMachineNo}, |
|||
'%') |
|||
</if> |
|||
<if test="cpDw != null and cpDw != ''">and CP_DW like concat('%', #{cpDw}, '%')</if> |
|||
<if test="wlCode != null and wlCode != ''">and Wl_Code like concat('%', #{wlCode}, '%')</if> |
|||
<if test="itemname != null and itemname != ''">and Itemname like concat('%', #{Itemname}, '%')</if> |
|||
<if test="itemstandard != null and itemstandard != ''">and Itemstandard like concat('%', #{Itemstandard}, |
|||
'%') |
|||
</if> |
|||
<if test="stockDw != null and stockDw != ''">and Stock_dw like concat('%', #{stockDw}, '%')</if> |
|||
<if test="useNum != null ">and Use_Num like concat('%', #{useNum}, '%')</if> |
|||
<if test="lostpre != null ">and lostpre like concat('%', #{lostpre}, '%')</if> |
|||
<if test="zpGuige != null and zpGuige != ''">and zp_guige like concat('%', #{zpGuige}, '%')</if> |
|||
<if test="zpUseNum != null ">and zp_use_num like concat('%', #{zpUseNum}, '%')</if> |
|||
<if test="mQty != null ">and m_qty like concat('%', #{mQty}, '%')</if> |
|||
<if test="memolist != null and memolist != ''">and memolist like concat('%', #{memolist}, '%')</if> |
|||
<if test="nowversion != null ">and nowversion like concat('%', #{nowversion}, '%')</if> |
|||
<if test="begindate != null ">and begindate like concat('%', #{begindate}, '%')</if> |
|||
<if test="endtime != null ">and endtime like concat('%', #{endtime}, '%')</if> |
|||
<if test="wldm != null and wldm != ''">and wldm like concat('%', #{wldm}, '%')</if> |
|||
<if test="customno != null and customno != ''">and customno like concat('%', #{customno}, '%')</if> |
|||
<if test="sendflag != null ">and sendflag like concat('%', #{sendflag}, '%')</if> |
|||
<if test="YDWDH != null ">and YDWDH like concat('%', #{YDWDH}, '%')</if> |
|||
<if test="ZLDWDH != null ">and ZLDWDH like concat('%', #{ZLDWDH}, '%')</if> |
|||
<if test="ylWeight != null ">and yl_weight like concat('%', #{ylWeight}, '%')</if> |
|||
<if test="zongzhongWeight != null ">and zongzhong_Weight like concat('%', #{zongzhongWeight}, '%')</if> |
|||
<if test="pno != null and pno != ''">and pno like concat('%', #{pno}, '%')</if> |
|||
<if test="Addtime != null ">and Addtime like concat('%', #{Addtime}, '%')</if> |
|||
<if test="fuWidth != null ">and Fu_Width like concat('%', #{fuWidth}, '%')</if> |
|||
<if test="yflItemclass != null and yflItemclass != ''">and YFL_ItemClass like concat('%', #{yflItemclass}, |
|||
'%') |
|||
</if> |
|||
<if test="mouldNo != null and mouldNo != ''">and Mould_No like concat('%', #{mouldNo}, '%')</if> |
|||
<if test="standNowversion != null ">and stand_nowversion like concat('%', #{standNowversion}, '%')</if> |
|||
<if test="comfirmFlag != null ">and Comfirm_Flag like concat('%', #{comfirmFlag}, '%')</if> |
|||
<if test="comfirmMan != null and comfirmMan != ''">and Comfirm_man like concat('%', #{comfirmMan}, '%') |
|||
</if> |
|||
<if test="comfirmDate != null ">and Comfirm_date like concat('%', #{comfirmDate}, '%')</if> |
|||
<if test="writeMan != null and writeMan != ''">and write_man like concat('%', #{writeMan}, '%')</if> |
|||
<if test="GongCha != null and GongCha != ''">and GongCha like concat('%', #{GongCha}, '%')</if> |
|||
<if test="factoryMouldNo != null and factoryMouldNo != ''">and Factory_Mould_no like concat('%', |
|||
#{factoryMouldNo}, '%') |
|||
</if> |
|||
<if test="mainMaterial != null ">and Main_Material like concat('%', #{mainMaterial}, '%')</if> |
|||
<if test="limitFlag != null ">and Limit_Flag like concat('%', #{limitFlag}, '%')</if> |
|||
<if test="gongchaMore != null ">and gongcha_more like concat('%', #{gongchaMore}, '%')</if> |
|||
<if test="gongchaSmall != null ">and gongcha_small like concat('%', #{gongchaSmall}, '%')</if> |
|||
<if test="changtime != null ">and changtime like concat('%', #{changtime}, '%')</if> |
|||
<if test="cpNum != null ">and CP_NUM like concat('%', #{cpNum}, '%')</if> |
|||
<if test="worklineclass != null and worklineclass != ''">and worklineclass like concat('%', |
|||
#{worklineclass}, '%') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
|
|||
|
|||
<select id="selectBomGroupByCPCode" parameterType="Bom" resultMap="BomResult"> |
|||
<include refid="selectBomVo"/> |
|||
<where> |
|||
<if test="cpCode != null and cpCode != ''">and CP_CODE = #{cpCode}</if> |
|||
<if test="versionNo != null and versionNo!= ''">and Version_No like concat('%', #{versionNo}, '%')</if> |
|||
</where> |
|||
</select> |
|||
<!-- <select id="selectBomById" parameterType="String" resultMap="BomResult">--> |
|||
<!-- <include refid="selectBomVo"/>--> |
|||
<!-- where Version_No = #{versionNo}--> |
|||
<!-- </select>--> |
|||
|
|||
<!-- <select id="selectBomByCPCode" parameterType="Bom" resultMap="BomResult">--> |
|||
<!-- <include refid="selectBomList"/>--> |
|||
|
|||
<!-- </select>--> |
|||
|
|||
<insert id="insertBom" parameterType="Bom"> |
|||
insert into bom |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="versionNo != null">Version_No,</if> |
|||
<if test="cpCode != null">CP_CODE,</if> |
|||
<if test="cpName != null">CP_NAME,</if> |
|||
<if test="cpType != null">CP_TYPE,</if> |
|||
<if test="cpMachineNo != null">CP_Machine_NO,</if> |
|||
<if test="cpDw != null">CP_DW,</if> |
|||
<if test="wlCode != null">Wl_Code,</if> |
|||
<if test="itemname != null">Itemname,</if> |
|||
<if test="itemstandard != null">Itemstandard,</if> |
|||
<if test="stockDw != null">Stock_dw,</if> |
|||
<if test="useNum != null">Use_Num,</if> |
|||
<if test="lostpre != null">lostpre,</if> |
|||
<if test="zpGuige != null">zp_guige,</if> |
|||
<if test="zpUseNum != null">zp_use_num,</if> |
|||
<if test="mQty != null">m_qty,</if> |
|||
<if test="memolist != null">memolist,</if> |
|||
<if test="nowversion != null">nowversion,</if> |
|||
<if test="begindate != null">begindate,</if> |
|||
<if test="endtime != null">endtime,</if> |
|||
<if test="wldm != null">wldm,</if> |
|||
<if test="customno != null">customno,</if> |
|||
<if test="sendflag != null">sendflag,</if> |
|||
<if test="YDWDH != null">YDWDH,</if> |
|||
<if test="ZLDWDH != null">ZLDWDH,</if> |
|||
<if test="ylWeight != null">yl_weight,</if> |
|||
<if test="zongzhongWeight != null">zongzhong_Weight,</if> |
|||
<if test="pno != null">pno,</if> |
|||
<if test="Addtime != null">Addtime,</if> |
|||
<if test="fuWidth != null">Fu_Width,</if> |
|||
<if test="yflItemclass != null">YFL_ItemClass,</if> |
|||
<if test="mouldNo != null">Mould_No,</if> |
|||
<if test="standNowversion != null">stand_nowversion,</if> |
|||
<if test="comfirmFlag != null">Comfirm_Flag,</if> |
|||
<if test="comfirmMan != null">Comfirm_man,</if> |
|||
<if test="comfirmDate != null">Comfirm_date,</if> |
|||
<if test="writeMan != null">write_man,</if> |
|||
<if test="GongCha != null">GongCha,</if> |
|||
<if test="factoryMouldNo != null">Factory_Mould_no,</if> |
|||
<if test="mainMaterial != null">Main_Material,</if> |
|||
<if test="limitFlag != null">Limit_Flag,</if> |
|||
<if test="gongchaMore != null">gongcha_more,</if> |
|||
<if test="gongchaSmall != null">gongcha_small,</if> |
|||
<if test="changtime != null">changtime,</if> |
|||
<if test="cpNum != null">CP_NUM,</if> |
|||
<if test="worklineclass != null">worklineclass,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="versionNo != null">#{versionNo},</if> |
|||
<if test="cpCode != null">#{cpCode},</if> |
|||
<if test="cpName != null">#{cpName},</if> |
|||
<if test="cpType != null">#{cpType},</if> |
|||
<if test="cpMachineNo != null">#{cpMachineNo},</if> |
|||
<if test="cpDw != null">#{cpDw},</if> |
|||
<if test="wlCode != null">#{wlCode},</if> |
|||
<if test="itemname != null">#{itemname},</if> |
|||
<if test="itemstandard != null">#{itemstandard},</if> |
|||
<if test="stockDw != null">#{stockDw},</if> |
|||
<if test="useNum != null">#{useNum},</if> |
|||
<if test="lostpre != null">#{lostpre},</if> |
|||
<if test="zpGuige != null">#{zpGuige},</if> |
|||
<if test="zpUseNum != null">#{zpUseNum},</if> |
|||
<if test="mQty != null">#{mQty},</if> |
|||
<if test="memolist != null">#{memolist},</if> |
|||
<if test="nowversion != null">#{nowversion},</if> |
|||
<if test="begindate != null">#{begindate},</if> |
|||
<if test="endtime != null">#{endtime},</if> |
|||
<if test="wldm != null">#{wldm},</if> |
|||
<if test="customno != null">#{customno},</if> |
|||
<if test="sendflag != null">#{sendflag},</if> |
|||
<if test="YDWDH != null">#{YDWDH},</if> |
|||
<if test="ZLDWDH != null">#{ZLDWDH},</if> |
|||
<if test="ylWeight != null">#{ylWeight},</if> |
|||
<if test="zongzhongWeight != null">#{zongzhongWeight},</if> |
|||
<if test="pno != null">#{pno},</if> |
|||
<if test="Addtime != null">#{Addtime},</if> |
|||
<if test="fuWidth != null">#{fuWidth},</if> |
|||
<if test="yflItemclass != null">#{yflItemclass},</if> |
|||
<if test="mouldNo != null">#{mouldNo},</if> |
|||
<if test="standNowversion != null">#{standNowversion},</if> |
|||
<if test="comfirmFlag != null">#{comfirmFlag},</if> |
|||
<if test="comfirmMan != null">#{comfirmMan},</if> |
|||
<if test="comfirmDate != null">#{comfirmDate},</if> |
|||
<if test="writeMan != null">#{writeMan},</if> |
|||
<if test="GongCha != null">#{GongCha},</if> |
|||
<if test="factoryMouldNo != null">#{factoryMouldNo},</if> |
|||
<if test="mainMaterial != null">#{mainMaterial},</if> |
|||
<if test="limitFlag != null">#{limitFlag},</if> |
|||
<if test="gongchaMore != null">#{gongchaMore},</if> |
|||
<if test="gongchaSmall != null">#{gongchaSmall},</if> |
|||
<if test="changtime != null">#{changtime},</if> |
|||
<if test="cpNum != null">#{cpNum},</if> |
|||
<if test="worklineclass != null">#{worklineclass},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateBom" parameterType="Bom"> |
|||
update bom |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="cpCode != null">CP_CODE = #{cpCode},</if> |
|||
<if test="cpName != null">CP_NAME = #{cpName},</if> |
|||
<if test="cpType != null">CP_TYPE = #{cpType},</if> |
|||
<if test="cpMachineNo != null">CP_Machine_NO = #{cpMachineNo},</if> |
|||
<if test="cpDw != null">CP_DW = #{cpDw},</if> |
|||
<if test="wlCode != null">Wl_Code = #{wlCode},</if> |
|||
<if test="itemname != null">Itemname = #{Itemname},</if> |
|||
<if test="itemstandard != null">Itemstandard = #{Itemstandard},</if> |
|||
<if test="stockDw != null">Stock_dw = #{stockDw},</if> |
|||
<if test="useNum != null">Use_Num = #{useNum},</if> |
|||
<if test="lostpre != null">lostpre = #{lostpre},</if> |
|||
<if test="zpGuige != null">zp_guige = #{zpGuige},</if> |
|||
<if test="zpUseNum != null">zp_use_num = #{zpUseNum},</if> |
|||
<if test="mQty != null">m_qty = #{mQty},</if> |
|||
<if test="memolist != null">memolist = #{memolist},</if> |
|||
<if test="nowversion != null">nowversion = #{nowversion},</if> |
|||
<if test="begindate != null">begindate = #{begindate},</if> |
|||
<if test="endtime != null">endtime = #{endtime},</if> |
|||
<if test="wldm != null">wldm = #{wldm},</if> |
|||
<if test="customno != null">customno = #{customno},</if> |
|||
<if test="sendflag != null">sendflag = #{sendflag},</if> |
|||
<if test="YDWDH != null">YDWDH = #{YDWDH},</if> |
|||
<if test="ZLDWDH != null">ZLDWDH = #{ZLDWDH},</if> |
|||
<if test="ylWeight != null">yl_weight = #{ylWeight},</if> |
|||
<if test="zongzhongWeight != null">zongzhong_Weight = #{zongzhongWeight},</if> |
|||
<if test="pno != null">pno = #{pno},</if> |
|||
<if test="Addtime != null">Addtime = #{Addtime},</if> |
|||
<if test="fuWidth != null">Fu_Width = #{fuWidth},</if> |
|||
<if test="yflItemclass != null">YFL_ItemClass = #{yflItemclass},</if> |
|||
<if test="mouldNo != null">Mould_No = #{mouldNo},</if> |
|||
<if test="standNowversion != null">stand_nowversion = #{standNowversion},</if> |
|||
<if test="comfirmFlag != null">Comfirm_Flag = #{comfirmFlag},</if> |
|||
<if test="comfirmMan != null">Comfirm_man = #{comfirmMan},</if> |
|||
<if test="comfirmDate != null">Comfirm_date = #{comfirmDate},</if> |
|||
<if test="writeMan != null">write_man = #{writeMan},</if> |
|||
<if test="GongCha != null">GongCha = #{GongCha},</if> |
|||
<if test="factoryMouldNo != null">Factory_Mould_no = #{factoryMouldNo},</if> |
|||
<if test="mainMaterial != null">Main_Material = #{mainMaterial},</if> |
|||
<if test="limitFlag != null">Limit_Flag = #{limitFlag},</if> |
|||
<if test="gongchaMore != null">gongcha_more = #{gongchaMore},</if> |
|||
<if test="gongchaSmall != null">gongcha_small = #{gongchaSmall},</if> |
|||
<if test="changtime != null">changtime = #{changtime},</if> |
|||
<if test="cpNum != null">CP_NUM = #{cpNum},</if> |
|||
<if test="worklineclass != null">worklineclass = #{worklineclass},</if> |
|||
</trim> |
|||
<!-- <where>--> |
|||
<!-- <if test="versionNo!=null and versionNo!=''">and Version_No = #{versionNo}</if>--> |
|||
<!-- </where>--> |
|||
where Version_No = #{versionNo} |
|||
</update> |
|||
|
|||
<delete id="deleteBomById" parameterType="String"> |
|||
delete from bom where Version_No = #{versionNo} |
|||
</delete> |
|||
|
|||
<delete id="deleteBomByIds" parameterType="String"> |
|||
delete from bom where Version_No in |
|||
<foreach item="versionNo" collection="array" open="(" separator="," close=")"> |
|||
#{versionNo} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
<delete id="deleteByItem" parameterType="Bom"> |
|||
delete from bom |
|||
<where> |
|||
<if test="versionNo != null and versionNo != ''">and Version_No = #{versionNo}</if> |
|||
<if test="cpCode != null and cpCode != ''">and CP_CODE = #{cpCode}</if> |
|||
<if test="wlCode != null and wlCode != ''">and Wl_Code = #{wlCode}</if> |
|||
</where> |
|||
</delete> |
|||
</mapper> |
@ -1,905 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('新增物料清单')" /> |
|||
<th:block th:include="include :: bootstrap-editable-css" /> |
|||
|
|||
</head> |
|||
<body class="gray-bg"> |
|||
<div class="container-div"> |
|||
<p>新增BOM</p> |
|||
<div class="row"> |
|||
<div class="col-sm-12"> |
|||
|
|||
</div> |
|||
<form class="form-horizontal m" id="form-bom-add"> |
|||
<div class="row"> |
|||
<div class="col-sm-6"> |
|||
成品代码: |
|||
<input id="cpCode" type="text" class="form-control" name="cpCode"> |
|||
</div> |
|||
<div class="col-sm-6"> |
|||
成品名称: |
|||
<input id="cpName" type="text" class="form-control" name="cpName"> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="row"> |
|||
<div class="col-sm-6"> |
|||
版本: |
|||
<input id="versionNo" type="text" class="form-control" name="versionNo"> |
|||
</div> |
|||
<div class="col-sm-6"> |
|||
型号: |
|||
<input id="cpType" type="text" class="form-control" name="cpType"> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-6"> |
|||
机种号码: |
|||
<input id="cpMachineNo" type="text" class="form-control" name="cpMachineNo"> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-6"> |
|||
客户料号: |
|||
<input id="wldm" type="text" class="form-control" name="wldm" readonly> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
|
|||
<button class="btn btn-success" id="btn_addBom" onclick="addBom()">新增</button> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrapTable-body"> |
|||
|
|||
</table> |
|||
<!-- <div class="row">--> |
|||
<!-- <div class="col-sm-12" style="text-align: center">--> |
|||
<!-- <button id="submit">提交</button>--> |
|||
<!-- <button id="cancel">取消</button>--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
</div> |
|||
|
|||
|
|||
<div class="modal inmodal" id="bomModal" tabindex="-1" |
|||
role="dilog" aria-hidden="true" style="padding-bottom: 100px;"> |
|||
<div class="modal-dialog" style="width: 800px"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button type="button" class="close" data-dismiss="modal" |
|||
aria-hidden="true"></button> |
|||
<h4 class="modal-title">选择物料</h4> |
|||
</div> |
|||
<div class="modal-body" style="text-align: center;"> |
|||
<div class="row" > |
|||
<div class="col-md-5"> |
|||
<form id="bomForm" class="form-group"> |
|||
<label class="control-label col-md-4">物料代码:</label> |
|||
<div class="col-md-8"> |
|||
<input type="text" class="form-control" name="wlCode" |
|||
id="wlCode"> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="col-md-2"> |
|||
<button type="button" class="btn btn-success" id="bomCodeSearch">搜索</button> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-md-12"> |
|||
<div class="table-responsive" > |
|||
<table id="bomTable" |
|||
class="table table-striped table-responsive" style="padding-bottom: 50px;"> |
|||
|
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<button class="btn btn-success" id="btn_addWaitTable" onclick="addBom2()">添加</button> |
|||
<div class="row"> |
|||
<div class="col-md-12"> |
|||
<div class="table-responsive" style="padding-bottom:30px; "> |
|||
<table id="bomTable2" |
|||
class="table table-striped table-responsive"> |
|||
|
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="modal-footer"> |
|||
<button type="button" class="btn btn-primary" |
|||
onClick="confirm();">确定</button> |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> |
|||
</div> |
|||
|
|||
</div> |
|||
<!-- /.modal-content --> |
|||
</div> |
|||
<!-- /.modal-dialog --> |
|||
</div> |
|||
|
|||
<div class="modal inmodal" id="cpModal" tabindex="-1" |
|||
role="dilog" aria-hidden="true"> |
|||
<div class="modal-dialog" style="width: 800px"> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button type="button" class="close" data-dismiss="modal" |
|||
aria-hidden="true"></button> |
|||
<h4 class="modal-title">选择成品</h4> |
|||
</div> |
|||
<div class="modal-body" style="text-align: center;"> |
|||
<div class="row"> |
|||
<div class="col-md-5"> |
|||
<form id="formId" class="form-group"> |
|||
<label class="control-label col-md-4">成品代码:</label> |
|||
<div class="col-md-8"> |
|||
<input type="text" class="form-control" name="wlCode" |
|||
id="cpCode2"> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="col-md-2"> |
|||
<button type="button" class="btn btn-success" id="cpCodeSearch">搜索</button> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-md-12"> |
|||
<div class="table-responsive"> |
|||
<table id="cpTable" |
|||
class="table table-striped table-responsive"> |
|||
|
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
<div class="modal-footer"> |
|||
<button type="button" class="btn btn-primary" |
|||
onClick="selWlCode();">选择</button> |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> |
|||
</div> |
|||
|
|||
</div> |
|||
<!-- /.modal-content --> |
|||
</div> |
|||
<!-- /.modal-dialog --> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
|
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: bootstrap-table-editable-js" /> |
|||
|
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "ck/bom"; |
|||
|
|||
function submit(){ |
|||
var cpCode=$("#cpCode").val(); |
|||
var versionNO=$("#versionNo").val(); |
|||
if (cpCode===("")||versionNO===("")){ |
|||
alert("代码或版本号不能为空"); |
|||
return false; |
|||
} |
|||
let formData=new FormData($("#form-bom-add")[0]); |
|||
var row=$("#bootstrapTable-body").bootstrapTable("getData",true); |
|||
formData.append("bomList",JSON.stringify(row)); |
|||
let data={}; |
|||
formData.forEach((value, key) => data[key] = value); |
|||
//console.log(cpCode+":"+versionNO); |
|||
//console.log(row); |
|||
console.log(data) |
|||
$.ajax({ |
|||
url:prefix+"/add", |
|||
data:{"jsonStr":JSON.stringify(data)}, |
|||
type:"post", |
|||
dataType:"json", |
|||
success:function (resp) { |
|||
if (resp.code===0){ |
|||
alert("添加成功!"); |
|||
//window.location.href=prefix; |
|||
var index = parent.layer.getFrameIndex(window.name); |
|||
var parent2 = window.parent; |
|||
parent2.$.table.refresh(); |
|||
parent.layer.close(index);//关闭当前页 |
|||
} else { |
|||
$.modal.msgError("添加失败!"); |
|||
} |
|||
}, |
|||
error:function () { |
|||
$.modal.msgError("后台出错了!"); |
|||
} |
|||
}) |
|||
} |
|||
|
|||
function remove2(wlCode) { |
|||
$("#bootstrapTable-body").bootstrapTable("remove", { |
|||
field: 'wlCode', |
|||
values: wlCode |
|||
}); |
|||
} |
|||
|
|||
//引入bom2表格 |
|||
function addBom2(){ |
|||
var row= $("#bomTable").bootstrapTable("getSelections"); |
|||
var count = $('#bomTable2').bootstrapTable('getData').length; |
|||
for(var i=0;i<row.length;i++){ |
|||
let bootstrapTable = $("#bomTable2").bootstrapTable("getRowByUniqueId",row[i].wlCode); |
|||
//alert(bootstrapTable); |
|||
if (bootstrapTable!=null){ |
|||
alert(bootstrapTable.wlCode+"已存在,不可重复添加!"); |
|||
continue; |
|||
} |
|||
$("#bomTable2").bootstrapTable('insertRow', {index:count+i, |
|||
row:{ |
|||
wldm:row[i].wldm, |
|||
wlCode:row[i].wlCode, |
|||
itemname:row[i].itemname, |
|||
itemstandard:row[i].itemstandard, |
|||
machineNo:row[i].machineNo, |
|||
stockDw:row[i].stockDw, |
|||
intakeorchina:row[i].intakeorchina, |
|||
weight:row[i].weight |
|||
} |
|||
}); |
|||
} |
|||
$("#bomTable").bootstrapTable("uncheckAll"); |
|||
} |
|||
|
|||
//移除bomtable2的对应行数据 |
|||
function remove(wlCode){ |
|||
$("#bomTable2").bootstrapTable("remove",{ |
|||
field:'wlCode', |
|||
values:wlCode |
|||
}); |
|||
} |
|||
|
|||
//点击引入按钮 |
|||
function addBom(){ |
|||
$("#bomModal").modal("show"); |
|||
} |
|||
|
|||
//确认 |
|||
function confirm(){ |
|||
var row=$("#bomTable2").bootstrapTable("getData",true); |
|||
var count = $('#bootstrapTable-body').bootstrapTable('getData').length; |
|||
for(var i=0;i<row.length;i++){ |
|||
let bootstrapTable = $("#bootstrapTable-body").bootstrapTable("getRowByUniqueId",row[i].wlCode); |
|||
//alert(bootstrapTable); |
|||
if (bootstrapTable!=null){ |
|||
alert(bootstrapTable.wldm+"已存在,不可重复添加!"); |
|||
continue; |
|||
} |
|||
$("#bootstrapTable-body").bootstrapTable('insertRow', {index:count+i, |
|||
row:{ |
|||
wldm:row[i].wldm, |
|||
wlCode:row[i].wlCode, |
|||
itemname:row[i].itemname, |
|||
itemstandard:row[i].itemstandard, |
|||
machineNo:row[i].machineNo, |
|||
stockDw:row[i].stockDw, |
|||
intakeorchina:row[i].intakeorchina, |
|||
weight:row[i].weight, |
|||
useNum:0, |
|||
lostpre:0 |
|||
} |
|||
}); |
|||
} |
|||
$("#bomModal").modal("hide"); |
|||
$("#bomTable2").bootstrapTable("removeAll"); |
|||
$("#wlCode").val(""); |
|||
$("#bomTable").bootstrapTable("refresh"); |
|||
} |
|||
|
|||
//选中成品 |
|||
function selWlCode(){ |
|||
var row=$('#cpTable').bootstrapTable('getSelections'); |
|||
$("#cpCode").val(row[0].wlCode); |
|||
$("#cpName").val(row[0].itemname); |
|||
$("#wldm").val(row[0].pWldm); |
|||
$("#cpModal").modal("hide"); |
|||
} |
|||
|
|||
//点击成品代码输入栏出模态框 |
|||
$("#cpCode").focus(function () { |
|||
// $("#btn_cpCode").click(); |
|||
console.log("123"); |
|||
$("#cpModal").modal("show"); |
|||
}); |
|||
|
|||
//点击搜索,刷新表格 |
|||
$("#cpCodeSearch").click(function () { |
|||
$('#cpTable').bootstrapTable('refresh'); |
|||
}); |
|||
|
|||
//查询参数 |
|||
function queryParams(params) { |
|||
var search = $.table.queryParams(params); |
|||
search.wlCode=$("#cpCode2").val(); |
|||
return search; |
|||
} |
|||
|
|||
//选择成品 |
|||
$('#cpTable').bootstrapTable({ |
|||
url : ctx + "ck/itemCP/list", |
|||
method : 'post', |
|||
striped : true, // 是否显示行间隔色 |
|||
cache : false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) |
|||
pagination : true, // 是否显示分页(*) |
|||
contentType :"application/x-www-form-urlencoded", |
|||
queryParams : function(params) { |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
pageSize: params.limit, |
|||
pageNum: params.offset / params.limit + 1, |
|||
searchValue: params.search, |
|||
orderByColumn: params.sort, |
|||
isAsc: params.order |
|||
}; |
|||
var json= $.extend(curParams, $.common.formToJSON("formId")); |
|||
console.log(json); |
|||
return json; |
|||
}, |
|||
sidePagination : "server", // 分页方式:client客户端分页,server服务端分页(*) |
|||
pageNumber : 1, // 初始化加载第一页,默认第一页 |
|||
pageSize : 10, // 每页的记录行数(*) |
|||
pageList : [ 5, 10,50], // 可供选择的每页的行数(*) |
|||
clickToSelect : true, // 是否启用点击选中行 |
|||
showToggle : false, // 是否显示详细视图和列表视图的切换按钮 |
|||
cardView : false, // 是否显示详细视图 |
|||
detailView : false, // 是否显示父子表 |
|||
smartDisplay : false, // 加了这个才显示每页显示的行数 |
|||
showExport : false, // 是否显示导出按钮 |
|||
singleSelect : true, |
|||
height:400, |
|||
columns : [ |
|||
{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'wldm', |
|||
title: '', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'wlCode', |
|||
title: '成品代码' |
|||
}, |
|||
{ |
|||
field: 'hsCode', |
|||
title: '', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'itemname', |
|||
title: '名称' |
|||
}, |
|||
{ |
|||
field: 'enName', |
|||
title: '', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'itemstandard', |
|||
title: '规格型号' |
|||
}, |
|||
{ |
|||
field: 'machineNo', |
|||
title: '机种', |
|||
}, |
|||
|
|||
{ |
|||
field: 'stockDw', |
|||
title: '库存单位' |
|||
}, |
|||
{ |
|||
field: 'pWldm', |
|||
title: '客户料号' |
|||
}, |
|||
{ |
|||
field: 'intakeorchina', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'weight', |
|||
title: '单位重量', |
|||
visible: false |
|||
} |
|||
] |
|||
|
|||
}); |
|||
|
|||
//全部itemList |
|||
$('#bomTable').bootstrapTable({ |
|||
url : ctx + "ck/itemCP/itemList", |
|||
method : 'post', |
|||
striped : true, // 是否显示行间隔色 |
|||
cache : false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) |
|||
pagination : true, // 是否显示分页(*) |
|||
contentType :"application/x-www-form-urlencoded", |
|||
queryParams : function(params) { |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
pageSize: params.limit, |
|||
pageNum: params.offset / params.limit + 1, |
|||
searchValue: params.search, |
|||
orderByColumn: params.sort, |
|||
isAsc: params.order |
|||
}; |
|||
var json= $.extend(curParams, $.common.formToJSON("bomForm")); |
|||
return json; |
|||
}, |
|||
sidePagination : "server", // 分页方式:client客户端分页,server服务端分页(*) |
|||
pageNumber : 1, // 初始化加载第一页,默认第一页 |
|||
pageSize : 5, // 每页的记录行数(*) |
|||
pageList : [ 5, 10,50], // 可供选择的每页的行数(*) |
|||
clickToSelect : true, // 是否启用点击选中行 |
|||
showToggle : false, // 是否显示详细视图和列表视图的切换按钮 |
|||
cardView : false, // 是否显示详细视图 |
|||
detailView : false, // 是否显示父子表 |
|||
smartDisplay : false, // 加了这个才显示每页显示的行数 |
|||
showExport : false, // 是否显示导出按钮 |
|||
// singleSelect : true, |
|||
height:350, |
|||
columns : [ |
|||
{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'wldm', |
|||
title: '', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'wlCode', |
|||
title: '物料代码' |
|||
}, |
|||
{ |
|||
field: 'hsCode', |
|||
title: '', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'itemname', |
|||
title: '名称' |
|||
}, |
|||
{ |
|||
field: 'enName', |
|||
title: '', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'itemstandard', |
|||
title: '规格型号' |
|||
}, |
|||
{ |
|||
field: 'machineNo', |
|||
title: '机种', |
|||
}, |
|||
{ |
|||
field: 'stockDw', |
|||
title: '库存单位' |
|||
}, |
|||
{ |
|||
field: 'pWldm', |
|||
title: '客户料号' |
|||
}, |
|||
{ |
|||
field: 'intakeorchina', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'weight', |
|||
title: '单位重量', |
|||
visible: false |
|||
} |
|||
] |
|||
|
|||
}); |
|||
|
|||
//待确认bom |
|||
$('#bomTable2').bootstrapTable({ |
|||
striped : true, // 是否显示行间隔色 |
|||
cache : false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) |
|||
// contentType :"application/x-www-form-urlencoded", |
|||
// pageNumber : 1, // 初始化加载第一页,默认第一页 |
|||
// pageSize : 10, // 每页的记录行数(*) |
|||
// pageList : [ 5, 10,50], // 可供选择的每页的行数(*) |
|||
// clickToSelect : true, // 是否启用点击选中行 |
|||
showToggle : false, // 是否显示详细视图和列表视图的切换按钮 |
|||
cardView : false, // 是否显示详细视图 |
|||
detailView : false, // 是否显示父子表 |
|||
smartDisplay : false, // 加了这个才显示每页显示的行数 |
|||
showExport : false, // 是否显示导出按钮 |
|||
singleSelect : true, |
|||
height:400, |
|||
uniqueId : 'wlCode', |
|||
columns : [ |
|||
{ |
|||
field: 'wldm', |
|||
title: '', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'wlCode', |
|||
title: '物料代码' |
|||
}, |
|||
{ |
|||
field: 'hsCode', |
|||
title: '', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'itemname', |
|||
title: '名称' |
|||
}, |
|||
{ |
|||
field: 'enName', |
|||
title: '', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'itemstandard', |
|||
title: '规格型号' |
|||
}, |
|||
{ |
|||
field: 'machineNo', |
|||
title: '机种', |
|||
}, |
|||
{ |
|||
field: 'stockDw', |
|||
title: '库存单位' |
|||
}, |
|||
{ |
|||
field: 'pWldm', |
|||
title: '客户料号' |
|||
}, |
|||
{ |
|||
field: 'intakeorchina', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'weight', |
|||
title: '单位重量', |
|||
visible: false |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function(value, row, index) { |
|||
var actions = []; |
|||
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="edit()"><i class="fa fa-edit"></i>编辑</a> '); |
|||
actions.push('<a class="btn btn-danger btn-xs ' + '" href="javascript:void(0)" onclick="remove(\'' + row.wlCode + '\')"><i class="fa fa-remove"></i>删除</a>'); |
|||
return actions.join(''); |
|||
} |
|||
} |
|||
] |
|||
|
|||
}); |
|||
|
|||
//准备提交的bom |
|||
$('#bootstrapTable-body').bootstrapTable({ |
|||
striped : true, // 是否显示行间隔色 |
|||
cache : false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) |
|||
// contentType :"application/x-www-form-urlencoded", |
|||
// pageNumber : 1, // 初始化加载第一页,默认第一页 |
|||
// pageSize : 10, // 每页的记录行数(*) |
|||
// pageList : [ 5, 10,50], // 可供选择的每页的行数(*) |
|||
// clickToSelect : true, // 是否启用点击选中行 |
|||
showToggle : false, // 是否显示详细视图和列表视图的切换按钮 |
|||
cardView : false, // 是否显示详细视图 |
|||
detailView : false, // 是否显示父子表 |
|||
smartDisplay : false, // 加了这个才显示每页显示的行数 |
|||
showExport : false, // 是否显示导出按钮 |
|||
singleSelect : true, |
|||
height:400, |
|||
uniqueId : 'wldm', |
|||
columns: [ |
|||
{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'cpCode', |
|||
title: '成品代码', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'cpName', |
|||
title: '成品名称', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'cpType', |
|||
title: '规格型号', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'cpDw', |
|||
title: '单位', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'wlCode', |
|||
title: '原料编号' |
|||
}, |
|||
{ |
|||
field: 'itemname', |
|||
title: '名称' |
|||
}, |
|||
{ |
|||
field: 'itemstandard', |
|||
title: '规格型号' |
|||
|
|||
}, |
|||
{ |
|||
field: 'stockDw', |
|||
title: '单位' |
|||
}, |
|||
{ |
|||
field: 'useNum', |
|||
title: '使用量', |
|||
// visible: false |
|||
editable : { |
|||
type : 'text', |
|||
title : '使用量', |
|||
validate : function(value) { |
|||
if (isNaN(value)) return '使用量必须是数字'; |
|||
var price = parseFloat(value); |
|||
if (price <= 0) return '使用量必须大于0'; |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'lostpre', |
|||
title: '损耗', |
|||
// visible: false |
|||
editable : { |
|||
type : 'text', |
|||
title : '损耗', |
|||
validate : function(value) { |
|||
if (isNaN(value)) return '损耗必须是数字'; |
|||
var lostpre = parseFloat(value); |
|||
if (lostpre < 0||lostpre>100) return '损耗必须大于等于0'; |
|||
} |
|||
} |
|||
}, |
|||
// { |
|||
// field: 'zpGuige', |
|||
// title: '厂商l料号' |
|||
// }, |
|||
{ |
|||
field: 'zpUseNum', |
|||
title: '成品数量', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'mQty', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'memolist', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'nowversion', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'begindate', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'endtime', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'wldm', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'customno', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'sendflag', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'yDWDH', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'zLDWDH', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'ylWeight', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'zongzhongWeight', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'pno', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'addtime', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'fuWidth', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'yflItemclass', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'mouldNo', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'standNowversion', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'comfirmFlag', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'comfirmMan', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'comfirmDate', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'writeMan', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'GongCha', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'factoryMouldNo', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'mainMaterial', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'limitFlag', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'gongchaMore', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'gongchaSmall', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'changtime', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'cpNum', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'worklineclass', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function(value, row, index) { |
|||
var actions = []; |
|||
actions.push('<a class="btn btn-danger btn-xs ' + '" href="javascript:void(0)" onclick="remove2(\'' + row.wlCode + '\')"><i class="fa fa-remove"></i>删除</a>'); |
|||
return actions.join(''); |
|||
} |
|||
}] |
|||
|
|||
}); |
|||
|
|||
$("#form-bom-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
submit(); |
|||
} |
|||
|
|||
$("#cancel").on("click",function (){ |
|||
window.location.href=prefix; |
|||
}) |
|||
|
|||
// $("input[name='begindate']").datetimepicker({ |
|||
// format: "yyyy-mm-dd", |
|||
// minView: "month", |
|||
// autoclose: true |
|||
// }); |
|||
// |
|||
// $("input[name='endtime']").datetimepicker({ |
|||
// format: "yyyy-mm-dd", |
|||
// minView: "month", |
|||
// autoclose: true |
|||
// }); |
|||
// |
|||
// $("input[name='Addtime']").datetimepicker({ |
|||
// format: "yyyy-mm-dd", |
|||
// minView: "month", |
|||
// autoclose: true |
|||
// }); |
|||
// |
|||
// $("input[name='comfirmDate']").datetimepicker({ |
|||
// format: "yyyy-mm-dd", |
|||
// minView: "month", |
|||
// autoclose: true |
|||
// }); |
|||
// |
|||
// $("input[name='changtime']").datetimepicker({ |
|||
// format: "yyyy-mm-dd", |
|||
// minView: "month", |
|||
// autoclose: true |
|||
// }); |
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,368 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
|||
<head> |
|||
<th:block th:include="include :: header('物料清单列表')"/> |
|||
<th:block th:include="include :: bootstrap-editable-css"/> |
|||
</head> |
|||
<body class="gray-bg"> |
|||
<div class="container-div"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formId"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>成品代码:</label> |
|||
<input type="text" name="cpCode"/> |
|||
</li> |
|||
<li> |
|||
<label>成品名称</label> |
|||
<input type="text" name="cpName"> |
|||
</li> |
|||
|
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i |
|||
class="fa fa-refresh"></i> 重置</a> |
|||
</li> |
|||
|
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="btn-group-sm" id="toolbar" role="group"> |
|||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="ck:bom:add"> |
|||
<i class="fa fa-plus"></i> 添加 |
|||
</a> |
|||
<a class="btn btn-primary single disabled" onclick="edit2()" shiro:hasPermission="ck:bom:edit"> |
|||
<i class="fa fa-edit"></i> 修改 |
|||
</a> |
|||
<a class="btn btn-danger multiple disabled" onclick="" |
|||
shiro:hasPermission="ck:bom:remove" disabled> |
|||
<i class="fa fa-remove"></i> 删除 |
|||
</a> |
|||
<a class="btn btn-warning" onclick="$.table.exportExcel()"> |
|||
<i class="fa fa-download"></i> 导出 |
|||
</a> |
|||
<a class="btn btn-warning" onclick="$.table.importExcel()"> |
|||
<i class="fa fa-upload"></i> 物料导入 |
|||
</a> |
|||
</div> |
|||
|
|||
<div class="col-sm-12 select-table table-striped" style="padding-bottom: 100px;"> |
|||
<table id="bootstrap-table"> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer"/> |
|||
<script th:inline="javascript"> |
|||
var editFlag = [[${@permission.hasPermi('ck:bom:edit')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('ck:bom:remove')}]]; |
|||
var prefix = ctx + "ck/bom"; |
|||
|
|||
|
|||
//打开添加页面 |
|||
function newTab() { |
|||
window.location.href = "/ck/bom/add"; |
|||
} |
|||
|
|||
function edit2() { |
|||
let data = $("#bootstrap-table").bootstrapTable("getSelections"); |
|||
let id = data[0].versionNo; |
|||
let cpCode = data[0].cpCode; |
|||
if ($.common.isNotEmpty(id) && $.common.isNotEmpty(cpCode)) { |
|||
let url = table.options.updateUrl.replace("{versionNo}", id); |
|||
url = url.replace("{cpCode}", cpCode); |
|||
$.modal.open("修改Bom信息" + table.options.modalName, url); |
|||
} |
|||
} |
|||
|
|||
$(function () { |
|||
let options = { |
|||
url: prefix + "/allList", |
|||
createUrl: prefix + "/add", |
|||
updateUrl: prefix + "/edit/{versionNo}/{cpCode}", |
|||
removeUrl: prefix + "/removeByCpcode", |
|||
exportUrl: prefix + "/export", |
|||
importUrl: prefix + "/importData", |
|||
importTemplateUrl: prefix + "/importTemplate", |
|||
modalName: "物料清单", |
|||
columns: [ |
|||
{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'versionNo', |
|||
title: '版本号', |
|||
// visible: false |
|||
}, |
|||
{ |
|||
field: 'cpCode', |
|||
title: '成品代码', |
|||
}, |
|||
{ |
|||
field: 'cpName', |
|||
title: '成品名称', |
|||
}, |
|||
{ |
|||
field: 'cpType', |
|||
title: '规格型号' |
|||
}, |
|||
{ |
|||
field: 'cpMachineNo', |
|||
title: '机种代码' |
|||
}, |
|||
{ |
|||
field: 'cpDw', |
|||
title: '单位' |
|||
}, |
|||
{ |
|||
field: 'wlCode', |
|||
title: '客户编号', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'itemname', |
|||
title: '道具名称', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'itemstandard', |
|||
title: '道具描述', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'stockDw', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'useNum', |
|||
title: '使用量', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'lostpre', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'zpGuige', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'zpUseNum', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'mQty', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'memolist', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'nowversion', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'begindate', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'endtime', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'wldm', |
|||
title: '客户料号', |
|||
}, |
|||
{ |
|||
field: 'customno', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'sendflag', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'YDWDH', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'ZLDWDH', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'ylWeight', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'zongzhongWeight', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'pno', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'Addtime', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'fuWidth', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'yflItemclass', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'mouldNo', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'standNowversion', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'comfirmFlag', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'comfirmMan', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'comfirmDate', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'writeMan', |
|||
title: '修改人', |
|||
}, |
|||
{ |
|||
field: 'GongCha', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'factoryMouldNo', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'mainMaterial', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'limitFlag', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'gongchaMore', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'gongchaSmall', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'changtime', |
|||
title: '修改时间', |
|||
}, |
|||
{ |
|||
field: 'cpNum', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'worklineclass', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function (value, row, index) { |
|||
var actions = []; |
|||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="" disabled><i class="fa fa-edit"></i>修改</a> '); |
|||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="" disabled ><i class="fa fa-remove"></i>删除</a>'); |
|||
return actions.join(''); |
|||
} |
|||
}] |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
|
|||
|
|||
function edit(id, cpCode) {//id指的是版本号 |
|||
var url = "/404.html"; |
|||
if ($.common.isNotEmpty(id) && $.common.isNotEmpty(cpCode)) { |
|||
url = table.options.updateUrl.replace("{versionNo}", id); |
|||
url = url.replace("{cpCode}", cpCode); |
|||
$.modal.openFull("查看Bom信息" + table.options.modalName, url); |
|||
} else { |
|||
|
|||
} |
|||
// return url; |
|||
} |
|||
|
|||
function remove(id, cpCode) { |
|||
table.set(); |
|||
var url = table.options.removeUrl; |
|||
|
|||
$.modal.confirm("确定删除该条" + table.options.modalName + "信息吗?", function () { |
|||
var bom = {"versionNo": id, "cpCode": cpCode}; |
|||
$.operate.submit(url, "post", "json", bom); |
|||
}); |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<script id="importTpl" type="text/template"> |
|||
<form enctype="multipart/form-data" class="mt20 mb10"> |
|||
<div class="col-xs-offset-1"> |
|||
<input type="file" id="file" name="file"/> |
|||
<div class="mt10 pt5"> |
|||
<input type="checkbox" id="updateSupport" name="updateSupport" title="如果数据已经存在,更新这条数据。"> 是否更新已经存在的数据 |
|||
<a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a> |
|||
</div> |
|||
<font color="red" class="pull-left mt10"> |
|||
提示:仅允许导入“xls”或“xlsx”格式文件! |
|||
</font> |
|||
</div> |
|||
</form> |
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,365 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org"> |
|||
<head> |
|||
<th:block th:include="include :: header('修改物料清单')"/> |
|||
<th:block th:include="include :: datetimepicker-css"/> |
|||
<th:block th:include="include :: bootstrap-editable-css"/> |
|||
<style> |
|||
|
|||
</style> |
|||
</head> |
|||
|
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<div class="row"> |
|||
<div class="col-sm-12" th:object="${bom}"> |
|||
<form class="form-horizontal m" id="bomForm"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">版本:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="versionNo" th:field="*{versionNo}" class="form-control" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">成品代码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="cpCode" th:field="*{cpCode}" class="form-control" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">机种代码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="cpMachineNo" th:field="*{cpMachineNo}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-table"></table> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
<th:block th:include="include :: footer"/> |
|||
<th:block th:include="include :: datetimepicker-js"/> |
|||
|
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "ck/bom"; |
|||
var editFlag = [[${@permission.hasPermi('ck:bom:edit')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('ck:bom:remove')}]]; |
|||
|
|||
|
|||
$(function () { |
|||
var options = { |
|||
url: prefix + "/cpyllist", |
|||
createUrl: prefix + "/add", |
|||
updateUrl: prefix + "/edit/{versionNo}/{cpCode}", |
|||
removeUrl: prefix + "/remove", |
|||
exportUrl: prefix + "/export", |
|||
modalName: "物料清单", |
|||
pageSize: '10', |
|||
contentType: "application/x-www-form-urlencoded; charset=UTF-8", |
|||
sidePagination: 'server',//设置为服务器端分页 |
|||
queryParamsType: "", |
|||
|
|||
queryParams: function (params) { |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
pageSize: params.limit, |
|||
pageNum: params.offset / params.limit + 1, |
|||
searchValue: params.search, |
|||
orderByColumn: params.sort, |
|||
isAsc: params.order, |
|||
versionNo: $("input[name='versionNo']").val(), |
|||
cpCode: $("input[name='cpCode']").val(), |
|||
}; |
|||
var currentId = $.common.isEmpty(table.options.formId) ? $('form').attr('id') : table.options.formId; |
|||
return $.extend(curParams, $.common.formToJSON(currentId)); |
|||
}, |
|||
|
|||
columns: [ |
|||
{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'versionNo', |
|||
title: '版本号', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'cpCode', |
|||
title: '成品代码', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'cpName', |
|||
title: '成品名称', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'cpType', |
|||
title: '规格型号', |
|||
visible: false |
|||
|
|||
}, |
|||
{ |
|||
field: 'cpMachineNo', |
|||
title: '机种代码' |
|||
}, |
|||
{ |
|||
field: 'cpDw', |
|||
title: '单位', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'wlCode', |
|||
title: '原料编号' |
|||
}, |
|||
{ |
|||
field: 'itemname', |
|||
title: '名称' |
|||
}, |
|||
{ |
|||
field: 'itemstandard', |
|||
title: '规格型号' |
|||
|
|||
}, |
|||
{ |
|||
field: 'stockDw', |
|||
title: '单位' |
|||
}, |
|||
{ |
|||
field: 'useNum', |
|||
title: '原辅料使用量' |
|||
}, |
|||
{ |
|||
field: 'lostpre', |
|||
title: '损耗' |
|||
}, |
|||
{ |
|||
field: 'zpGuige', |
|||
title: '厂商l料号', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'zpUseNum', |
|||
title: '成品数量', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'mQty', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'memolist', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'nowversion', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'begindate', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'endtime', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'wldm', |
|||
title: '客户料号', |
|||
}, |
|||
{ |
|||
field: 'customno', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'sendflag', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'yDWDH', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'zLDWDH', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'ylWeight', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'zongzhongWeight', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'pno', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'addtime', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'fuWidth', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'yflItemclass', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'mouldNo', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'standNowversion', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'comfirmFlag', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'comfirmMan', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'comfirmDate', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'writeMan', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'GongCha', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'factoryMouldNo', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'mainMaterial', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'limitFlag', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'gongchaMore', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'gongchaSmall', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'changtime', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'cpNum', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'worklineclass', |
|||
title: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function (value, row, index) { |
|||
var actions = []; |
|||
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="edit(\'' + row.versionNo + '\',\'' + row.cpCode + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
|||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="remove(\'' + row.wlCode + '\')"><i class="fa fa-remove"></i>删除</a>'); |
|||
return actions.join(''); |
|||
} |
|||
}] |
|||
}; |
|||
|
|||
$.table.init(options); |
|||
|
|||
}); |
|||
|
|||
//移除bomtable2的对应行数据 |
|||
function remove(wlCode) { |
|||
$("#bootstrap-table").bootstrapTable("remove", { |
|||
field: 'wlCode', |
|||
values: wlCode |
|||
}); |
|||
} |
|||
|
|||
function submitHandler() { |
|||
submit(); |
|||
} |
|||
|
|||
//提交 |
|||
function submit() { |
|||
let bootstrapTable = $("#bootstrap-table").bootstrapTable("getData", true); |
|||
let formData = new FormData($("#bomForm")[0]); |
|||
formData.append("bomList", JSON.stringify(bootstrapTable)); |
|||
let data1 = {}; |
|||
formData.forEach((value, key) => data1[key] = value); |
|||
//alert(JSON.stringify(data1)); |
|||
$.ajax({ |
|||
url: prefix + "/edit", |
|||
type: "post", |
|||
resultType: "json", |
|||
data: {"jsonStr": JSON.stringify(data1)}, |
|||
success: function (resp) { |
|||
if (resp.code === 0) { |
|||
alert("修改成功!"); |
|||
// window.location.href = prefix; |
|||
var index = parent.layer.getFrameIndex(window.name); |
|||
var parent2 = window.parent; |
|||
parent2.$.table.refresh(); |
|||
parent.layer.close(index);//关闭当前页 |
|||
} else { |
|||
$.modal.msgError("修改失败!"); |
|||
} |
|||
}, |
|||
error: function () { |
|||
$.modal.msgError("出错了!"); |
|||
} |
|||
}); |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue