youjianchi
5 months ago
18 changed files with 1430 additions and 49 deletions
@ -0,0 +1,151 @@ |
|||
package com.ruoyi.system.controller; |
|||
|
|||
import java.util.List; |
|||
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.GetMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.ResponseBody; |
|||
import com.ruoyi.common.annotation.Log; |
|||
import com.ruoyi.common.enums.BusinessType; |
|||
import com.ruoyi.system.domain.SysMakeorderPickDetail; |
|||
import com.ruoyi.system.service.ISysMakeorderPickDetailService; |
|||
import com.ruoyi.common.core.controller.BaseController; |
|||
import com.ruoyi.common.core.domain.AjaxResult; |
|||
import com.ruoyi.common.utils.poi.ExcelUtil; |
|||
import com.ruoyi.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 生产订单领料明细Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-04-13 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/system/detail") |
|||
public class SysMakeorderPickDetailController extends BaseController |
|||
{ |
|||
private String prefix = "system/detail"; |
|||
|
|||
@Autowired |
|||
private ISysMakeorderPickDetailService sysMakeorderPickDetailService; |
|||
|
|||
@RequiresPermissions("system:detail:view") |
|||
@GetMapping() |
|||
public String detail() |
|||
{ |
|||
return prefix + "/detail"; |
|||
} |
|||
|
|||
/** |
|||
* 查询生产订单领料明细列表 |
|||
*/ |
|||
@RequiresPermissions("system:detail:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(SysMakeorderPickDetail sysMakeorderPickDetail) |
|||
{ |
|||
startPage(); |
|||
List<SysMakeorderPickDetail> list = sysMakeorderPickDetailService.selectSysMakeorderPickDetailList(sysMakeorderPickDetail); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出生产订单领料明细列表 |
|||
*/ |
|||
@RequiresPermissions("system:detail:export") |
|||
@Log(title = "生产订单领料明细", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ResponseBody |
|||
public AjaxResult export(SysMakeorderPickDetail sysMakeorderPickDetail) |
|||
{ |
|||
List<SysMakeorderPickDetail> list = sysMakeorderPickDetailService.selectSysMakeorderPickDetailList(sysMakeorderPickDetail); |
|||
ExcelUtil<SysMakeorderPickDetail> util = new ExcelUtil<SysMakeorderPickDetail>(SysMakeorderPickDetail.class); |
|||
return util.exportExcel(list, "生产订单领料明细数据"); |
|||
} |
|||
|
|||
/** |
|||
* 新增生产订单领料明细 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() |
|||
{ |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存生产订单领料明细 |
|||
*/ |
|||
@RequiresPermissions("system:detail:add") |
|||
@Log(title = "生产订单领料明细", businessType = BusinessType.INSERT) |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public AjaxResult addSave(SysMakeorderPickDetail sysMakeorderPickDetail) |
|||
{ |
|||
return toAjax(sysMakeorderPickDetailService.insertSysMakeorderPickDetail(sysMakeorderPickDetail)); |
|||
} |
|||
|
|||
/** |
|||
* 修改生产订单领料明细 |
|||
*/ |
|||
@GetMapping("/edit/{id}") |
|||
public String edit(@PathVariable("id") Long id, ModelMap mmap) |
|||
{ |
|||
SysMakeorderPickDetail sysMakeorderPickDetail = sysMakeorderPickDetailService.selectSysMakeorderPickDetailById(id); |
|||
mmap.put("sysMakeorderPickDetail", sysMakeorderPickDetail); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存生产订单领料明细 |
|||
*/ |
|||
@RequiresPermissions("system:detail:edit") |
|||
@Log(title = "生产订单领料明细", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public AjaxResult editSave(SysMakeorderPickDetail sysMakeorderPickDetail) |
|||
{ |
|||
return toAjax(sysMakeorderPickDetailService.updateSysMakeorderPickDetail(sysMakeorderPickDetail)); |
|||
} |
|||
|
|||
/** |
|||
* 删除生产订单领料明细 |
|||
*/ |
|||
@RequiresPermissions("system:detail:remove") |
|||
@Log(title = "生产订单领料明细", businessType = BusinessType.DELETE) |
|||
@PostMapping( "/remove") |
|||
@ResponseBody |
|||
public AjaxResult remove(String ids) |
|||
{ |
|||
return toAjax(sysMakeorderPickDetailService.deleteSysMakeorderPickDetailByIds(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 作废生产订单领料明细 |
|||
*/ |
|||
@RequiresPermissions("system:detail:cancel") |
|||
@Log(title = "生产订单领料明细", businessType = BusinessType.CANCEL) |
|||
@GetMapping( "/cancel/{id}") |
|||
@ResponseBody |
|||
public AjaxResult cancel(@PathVariable("id") Long id){ |
|||
return toAjax(sysMakeorderPickDetailService.cancelSysMakeorderPickDetailById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 恢复生产订单领料明细 |
|||
*/ |
|||
@RequiresPermissions("system:detail:restore") |
|||
@Log(title = "生产订单领料明细", businessType = BusinessType.RESTORE) |
|||
@GetMapping( "/restore/{id}") |
|||
@ResponseBody |
|||
public AjaxResult restore(@PathVariable("id")Long id) |
|||
{ |
|||
return toAjax(sysMakeorderPickDetailService.restoreSysMakeorderPickDetailById(id)); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,125 @@ |
|||
package com.ruoyi.system.domain; |
|||
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.ruoyi.common.annotation.Excel; |
|||
import com.ruoyi.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 生产订单领料明细对象 sys_makeorder_pick_detail |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-04-13 |
|||
*/ |
|||
public class SysMakeorderPickDetail extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 主键ID */ |
|||
private Long id; |
|||
|
|||
/** 删除标志(0代表存在 1代表删除) */ |
|||
private String delFlag; |
|||
|
|||
/** 生产订单号 */ |
|||
@Excel(name = "生产订单号") |
|||
private String makeNo; |
|||
|
|||
/** 生产领料单号 */ |
|||
@Excel(name = "生产领料单号") |
|||
private String pickNo; |
|||
|
|||
/** 料号 */ |
|||
@Excel(name = "料号") |
|||
private String materialNo; |
|||
|
|||
/** bomid */ |
|||
@Excel(name = "bomid") |
|||
private Long bomId; |
|||
|
|||
/** 领料数量 */ |
|||
@Excel(name = "领料数量") |
|||
private Long pickNum; |
|||
|
|||
public void setId(Long id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Long getId() |
|||
{ |
|||
return id; |
|||
} |
|||
public void setDelFlag(String delFlag) |
|||
{ |
|||
this.delFlag = delFlag; |
|||
} |
|||
|
|||
public String getDelFlag() |
|||
{ |
|||
return delFlag; |
|||
} |
|||
public void setMakeNo(String makeNo) |
|||
{ |
|||
this.makeNo = makeNo; |
|||
} |
|||
|
|||
public String getMakeNo() |
|||
{ |
|||
return makeNo; |
|||
} |
|||
public void setPickNo(String pickNo) |
|||
{ |
|||
this.pickNo = pickNo; |
|||
} |
|||
|
|||
public String getPickNo() |
|||
{ |
|||
return pickNo; |
|||
} |
|||
public void setMaterialNo(String materialNo) |
|||
{ |
|||
this.materialNo = materialNo; |
|||
} |
|||
|
|||
public String getMaterialNo() |
|||
{ |
|||
return materialNo; |
|||
} |
|||
public void setBomId(Long bomId) |
|||
{ |
|||
this.bomId = bomId; |
|||
} |
|||
|
|||
public Long getBomId() |
|||
{ |
|||
return bomId; |
|||
} |
|||
public void setPickNum(Long pickNum) |
|||
{ |
|||
this.pickNum = pickNum; |
|||
} |
|||
|
|||
public Long getPickNum() |
|||
{ |
|||
return pickNum; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("delFlag", getDelFlag()) |
|||
.append("createBy", getCreateBy()) |
|||
.append("createTime", getCreateTime()) |
|||
.append("updateBy", getUpdateBy()) |
|||
.append("updateTime", getUpdateTime()) |
|||
.append("remark", getRemark()) |
|||
.append("makeNo", getMakeNo()) |
|||
.append("pickNo", getPickNo()) |
|||
.append("materialNo", getMaterialNo()) |
|||
.append("bomId", getBomId()) |
|||
.append("pickNum", getPickNum()) |
|||
.toString(); |
|||
} |
|||
} |
@ -0,0 +1,77 @@ |
|||
package com.ruoyi.system.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.system.domain.SysMakeorderPickDetail; |
|||
|
|||
/** |
|||
* 生产订单领料明细Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-04-13 |
|||
*/ |
|||
public interface SysMakeorderPickDetailMapper |
|||
{ |
|||
/** |
|||
* 查询生产订单领料明细 |
|||
* |
|||
* @param id 生产订单领料明细ID |
|||
* @return 生产订单领料明细 |
|||
*/ |
|||
public SysMakeorderPickDetail selectSysMakeorderPickDetailById(Long id); |
|||
|
|||
/** |
|||
* 查询生产订单领料明细列表 |
|||
* |
|||
* @param sysMakeorderPickDetail 生产订单领料明细 |
|||
* @return 生产订单领料明细集合 |
|||
*/ |
|||
public List<SysMakeorderPickDetail> selectSysMakeorderPickDetailList(SysMakeorderPickDetail sysMakeorderPickDetail); |
|||
|
|||
/** |
|||
* 新增生产订单领料明细 |
|||
* |
|||
* @param sysMakeorderPickDetail 生产订单领料明细 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertSysMakeorderPickDetail(SysMakeorderPickDetail sysMakeorderPickDetail); |
|||
|
|||
/** |
|||
* 修改生产订单领料明细 |
|||
* |
|||
* @param sysMakeorderPickDetail 生产订单领料明细 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateSysMakeorderPickDetail(SysMakeorderPickDetail sysMakeorderPickDetail); |
|||
|
|||
/** |
|||
* 删除生产订单领料明细 |
|||
* |
|||
* @param id 生产订单领料明细ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysMakeorderPickDetailById(Long id); |
|||
|
|||
/** |
|||
* 批量删除生产订单领料明细 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysMakeorderPickDetailByIds(String[] ids); |
|||
|
|||
/** |
|||
* 作废生产订单领料明细 |
|||
* |
|||
* @param id 生产订单领料明细ID |
|||
* @return 结果 |
|||
*/ |
|||
public int cancelSysMakeorderPickDetailById(Long id); |
|||
|
|||
/** |
|||
* 恢复生产订单领料明细 |
|||
* |
|||
* @param id 生产订单领料明细ID |
|||
* @return 结果 |
|||
*/ |
|||
public int restoreSysMakeorderPickDetailById(Long id); |
|||
} |
@ -0,0 +1,75 @@ |
|||
package com.ruoyi.system.service; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.system.domain.SysMakeorderPickDetail; |
|||
|
|||
/** |
|||
* 生产订单领料明细Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-04-13 |
|||
*/ |
|||
public interface ISysMakeorderPickDetailService |
|||
{ |
|||
/** |
|||
* 查询生产订单领料明细 |
|||
* |
|||
* @param id 生产订单领料明细ID |
|||
* @return 生产订单领料明细 |
|||
*/ |
|||
public SysMakeorderPickDetail selectSysMakeorderPickDetailById(Long id); |
|||
|
|||
/** |
|||
* 查询生产订单领料明细列表 |
|||
* |
|||
* @param sysMakeorderPickDetail 生产订单领料明细 |
|||
* @return 生产订单领料明细集合 |
|||
*/ |
|||
public List<SysMakeorderPickDetail> selectSysMakeorderPickDetailList(SysMakeorderPickDetail sysMakeorderPickDetail); |
|||
|
|||
/** |
|||
* 新增生产订单领料明细 |
|||
* |
|||
* @param sysMakeorderPickDetail 生产订单领料明细 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertSysMakeorderPickDetail(SysMakeorderPickDetail sysMakeorderPickDetail); |
|||
|
|||
/** |
|||
* 修改生产订单领料明细 |
|||
* |
|||
* @param sysMakeorderPickDetail 生产订单领料明细 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateSysMakeorderPickDetail(SysMakeorderPickDetail sysMakeorderPickDetail); |
|||
|
|||
/** |
|||
* 批量删除生产订单领料明细 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysMakeorderPickDetailByIds(String ids); |
|||
|
|||
/** |
|||
* 删除生产订单领料明细信息 |
|||
* |
|||
* @param id 生产订单领料明细ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysMakeorderPickDetailById(Long id); |
|||
|
|||
/** |
|||
* 作废生产订单领料明细 |
|||
* @param id 生产订单领料明细ID |
|||
* @return |
|||
*/ |
|||
int cancelSysMakeorderPickDetailById(Long id); |
|||
|
|||
/** |
|||
* 恢复生产订单领料明细 |
|||
* @param id 生产订单领料明细ID |
|||
* @return |
|||
*/ |
|||
int restoreSysMakeorderPickDetailById(Long id); |
|||
} |
@ -0,0 +1,126 @@ |
|||
package com.ruoyi.system.service.impl; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.common.utils.DateUtils; |
|||
import com.ruoyi.common.utils.ShiroUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.ruoyi.system.mapper.SysMakeorderPickDetailMapper; |
|||
import com.ruoyi.system.domain.SysMakeorderPickDetail; |
|||
import com.ruoyi.system.service.ISysMakeorderPickDetailService; |
|||
import com.ruoyi.common.core.text.Convert; |
|||
|
|||
/** |
|||
* 生产订单领料明细Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-04-13 |
|||
*/ |
|||
@Service |
|||
public class SysMakeorderPickDetailServiceImpl implements ISysMakeorderPickDetailService |
|||
{ |
|||
@Autowired |
|||
private SysMakeorderPickDetailMapper sysMakeorderPickDetailMapper; |
|||
|
|||
/** |
|||
* 查询生产订单领料明细 |
|||
* |
|||
* @param id 生产订单领料明细ID |
|||
* @return 生产订单领料明细 |
|||
*/ |
|||
@Override |
|||
public SysMakeorderPickDetail selectSysMakeorderPickDetailById(Long id) |
|||
{ |
|||
return sysMakeorderPickDetailMapper.selectSysMakeorderPickDetailById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询生产订单领料明细列表 |
|||
* |
|||
* @param sysMakeorderPickDetail 生产订单领料明细 |
|||
* @return 生产订单领料明细 |
|||
*/ |
|||
@Override |
|||
public List<SysMakeorderPickDetail> selectSysMakeorderPickDetailList(SysMakeorderPickDetail sysMakeorderPickDetail) |
|||
{ |
|||
return sysMakeorderPickDetailMapper.selectSysMakeorderPickDetailList(sysMakeorderPickDetail); |
|||
} |
|||
|
|||
/** |
|||
* 新增生产订单领料明细 |
|||
* |
|||
* @param sysMakeorderPickDetail 生产订单领料明细 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertSysMakeorderPickDetail(SysMakeorderPickDetail sysMakeorderPickDetail) |
|||
{ |
|||
String loginName = ShiroUtils.getLoginName(); |
|||
sysMakeorderPickDetail.setCreateBy(loginName); |
|||
sysMakeorderPickDetail.setCreateTime(DateUtils.getNowDate()); |
|||
return sysMakeorderPickDetailMapper.insertSysMakeorderPickDetail(sysMakeorderPickDetail); |
|||
} |
|||
|
|||
/** |
|||
* 修改生产订单领料明细 |
|||
* |
|||
* @param sysMakeorderPickDetail 生产订单领料明细 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateSysMakeorderPickDetail(SysMakeorderPickDetail sysMakeorderPickDetail) |
|||
{ |
|||
String loginName = ShiroUtils.getLoginName(); |
|||
sysMakeorderPickDetail.setUpdateBy(loginName); |
|||
sysMakeorderPickDetail.setUpdateTime(DateUtils.getNowDate()); |
|||
return sysMakeorderPickDetailMapper.updateSysMakeorderPickDetail(sysMakeorderPickDetail); |
|||
} |
|||
|
|||
/** |
|||
* 删除生产订单领料明细对象 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteSysMakeorderPickDetailByIds(String ids) |
|||
{ |
|||
return sysMakeorderPickDetailMapper.deleteSysMakeorderPickDetailByIds(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 删除生产订单领料明细信息 |
|||
* |
|||
* @param id 生产订单领料明细ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteSysMakeorderPickDetailById(Long id) |
|||
{ |
|||
return sysMakeorderPickDetailMapper.deleteSysMakeorderPickDetailById(id); |
|||
} |
|||
|
|||
/** |
|||
* 作废生产订单领料明细 |
|||
* |
|||
* @param id 生产订单领料明细ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int cancelSysMakeorderPickDetailById(Long id) |
|||
{ |
|||
return sysMakeorderPickDetailMapper.cancelSysMakeorderPickDetailById(id); |
|||
} |
|||
|
|||
/** |
|||
* 恢复生产订单领料明细信息 |
|||
* |
|||
* @param id 生产订单领料明细ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int restoreSysMakeorderPickDetailById(Long id) |
|||
{ |
|||
return sysMakeorderPickDetailMapper.restoreSysMakeorderPickDetailById(id); |
|||
} |
|||
} |
@ -0,0 +1,109 @@ |
|||
<?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.system.mapper.SysMakeorderPickDetailMapper"> |
|||
|
|||
<resultMap type="SysMakeorderPickDetail" id="SysMakeorderPickDetailResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="delFlag" column="del_flag" /> |
|||
<result property="createBy" column="create_by" /> |
|||
<result property="createTime" column="create_time" /> |
|||
<result property="updateBy" column="update_by" /> |
|||
<result property="updateTime" column="update_time" /> |
|||
<result property="remark" column="remark" /> |
|||
<result property="makeNo" column="make_no" /> |
|||
<result property="pickNo" column="pick_no" /> |
|||
<result property="materialNo" column="material_no" /> |
|||
<result property="bomId" column="bom_id" /> |
|||
<result property="pickNum" column="pick_num" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectSysMakeorderPickDetailVo"> |
|||
select id, del_flag, create_by, create_time, update_by, update_time, remark, make_no, pick_no, material_no, bom_id, pick_num from sys_makeorder_pick_detail |
|||
</sql> |
|||
|
|||
<select id="selectSysMakeorderPickDetailList" parameterType="SysMakeorderPickDetail" resultMap="SysMakeorderPickDetailResult"> |
|||
<include refid="selectSysMakeorderPickDetailVo"/> |
|||
<where> |
|||
<if test="makeNo != null and makeNo != ''"> and make_no = #{makeNo}</if> |
|||
<if test="pickNo != null and pickNo != ''"> and pick_no = #{pickNo}</if> |
|||
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if> |
|||
<if test="bomId != null "> and bom_id = #{bomId}</if> |
|||
<if test="pickNum != null "> and pick_num = #{pickNum}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectSysMakeorderPickDetailById" parameterType="Long" resultMap="SysMakeorderPickDetailResult"> |
|||
<include refid="selectSysMakeorderPickDetailVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertSysMakeorderPickDetail" parameterType="SysMakeorderPickDetail" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into sys_makeorder_pick_detail |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="delFlag != null">del_flag,</if> |
|||
<if test="createBy != null">create_by,</if> |
|||
<if test="createTime != null">create_time,</if> |
|||
<if test="updateBy != null">update_by,</if> |
|||
<if test="updateTime != null">update_time,</if> |
|||
<if test="remark != null">remark,</if> |
|||
<if test="makeNo != null">make_no,</if> |
|||
<if test="pickNo != null">pick_no,</if> |
|||
<if test="materialNo != null">material_no,</if> |
|||
<if test="bomId != null">bom_id,</if> |
|||
<if test="pickNum != null">pick_num,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="delFlag != null">#{delFlag},</if> |
|||
<if test="createBy != null">#{createBy},</if> |
|||
<if test="createTime != null">#{createTime},</if> |
|||
<if test="updateBy != null">#{updateBy},</if> |
|||
<if test="updateTime != null">#{updateTime},</if> |
|||
<if test="remark != null">#{remark},</if> |
|||
<if test="makeNo != null">#{makeNo},</if> |
|||
<if test="pickNo != null">#{pickNo},</if> |
|||
<if test="materialNo != null">#{materialNo},</if> |
|||
<if test="bomId != null">#{bomId},</if> |
|||
<if test="pickNum != null">#{pickNum},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateSysMakeorderPickDetail" parameterType="SysMakeorderPickDetail"> |
|||
update sys_makeorder_pick_detail |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="delFlag != null">del_flag = #{delFlag},</if> |
|||
<if test="createBy != null">create_by = #{createBy},</if> |
|||
<if test="createTime != null">create_time = #{createTime},</if> |
|||
<if test="updateBy != null">update_by = #{updateBy},</if> |
|||
<if test="updateTime != null">update_time = #{updateTime},</if> |
|||
<if test="remark != null">remark = #{remark},</if> |
|||
<if test="makeNo != null">make_no = #{makeNo},</if> |
|||
<if test="pickNo != null">pick_no = #{pickNo},</if> |
|||
<if test="materialNo != null">material_no = #{materialNo},</if> |
|||
<if test="bomId != null">bom_id = #{bomId},</if> |
|||
<if test="pickNum != null">pick_num = #{pickNum},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteSysMakeorderPickDetailById" parameterType="Long"> |
|||
delete from sys_makeorder_pick_detail where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteSysMakeorderPickDetailByIds" parameterType="String"> |
|||
delete from sys_makeorder_pick_detail where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
<update id="cancelSysMakeorderPickDetailById" parameterType="Long"> |
|||
update sys_makeorder_pick_detail set del_flag = '1' where id = #{id} |
|||
</update> |
|||
|
|||
<update id="restoreSysMakeorderPickDetailById" parameterType="Long"> |
|||
update sys_makeorder_pick_detail set del_flag = '0' where id = #{id} |
|||
</update> |
|||
|
|||
</mapper> |
@ -0,0 +1,355 @@ |
|||
<!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" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-makeorder-edit" th:object="${sysMakeOrder}"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">生产订单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly id="makeNo" name="makeNo" th:field="*{makeNo}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">关联销售订单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly id="saleNo" name="saleNo" th:field="*{saleNo}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">业务员:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly name="Salesman" th:field="*{Salesman}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">订单类型:</label> |
|||
<div class="col-sm-8"> |
|||
<select disabled name="salesOrderType" class="form-control" type="text" th:with="dictList=${@dict.getType('sys_order_type')}" required> |
|||
<option value="">请选择</option> |
|||
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="row"> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-sub-table-1"></table> |
|||
</div> |
|||
</div> |
|||
|
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "system/makeorder"; |
|||
|
|||
var curUser = [[${currentUser}]]; |
|||
var curUsrDeptNumber = curUser.dept.deptNumber; |
|||
|
|||
// 字典 |
|||
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
|||
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; |
|||
var levelDatas = [[${@dict.getType('bomLevel')}]]; |
|||
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
|||
|
|||
// var subTableFormArray = []; |
|||
|
|||
$(function(){ |
|||
var options = { |
|||
url: ctx + "system/orderChild/list", |
|||
id: 'bootstrap-sub-table-1', |
|||
showSearch: false, |
|||
showRefresh: false, |
|||
showToggle: false, |
|||
showColumns: false, |
|||
uniqueId: "id", |
|||
pagination: false, // 设置不分页 |
|||
sidePagination: "client", |
|||
queryParams: queryParams, |
|||
detailView: true, |
|||
onExpandRow : function(index, row, $detail) { |
|||
initChildTable(index, row, $detail); |
|||
}, |
|||
/*onCollapseRow: function(index, row){ |
|||
var childTableFormId = 'child_table_form_'+index; |
|||
var formData = $('#'+childTableFormId).serialize(); |
|||
var formObj = $.common.formDataToObj(formData); |
|||
subTableFormArray.push(formObj); |
|||
},*/ |
|||
columns: [ |
|||
{ |
|||
field: 'id', |
|||
title: '主键id', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'quoteId', |
|||
title: '关联销售订单编号', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'bomId', |
|||
title: 'bom主键Id', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'materialCode', |
|||
align: 'center', |
|||
title: '料号' |
|||
}, |
|||
{ |
|||
field: 'materialName', |
|||
align: 'center', |
|||
title: '物料名称', |
|||
}, |
|||
{ |
|||
field: 'materialType', |
|||
align: 'center', |
|||
title: '物料类型', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectCategoryLabel(materialTypeDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'unit', |
|||
align: 'center', |
|||
title: '单位', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(sysUnitClassDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'brand', |
|||
align: 'center', |
|||
title: '品牌' |
|||
}, |
|||
{ |
|||
field: 'describe', |
|||
align: 'center', |
|||
title: '描述' |
|||
}, |
|||
{ |
|||
field: 'processMethod', |
|||
align: 'center', |
|||
title: '加工方式', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(processMethodDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'deliveryTime', |
|||
align: 'center', |
|||
title: '客户期望交付时间' |
|||
}, |
|||
{ |
|||
field: 'materialNum', |
|||
align: 'center', |
|||
title: '订单数量' |
|||
} |
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
}) |
|||
|
|||
initChildTable = function(index, row, $detail) { |
|||
var parentRow = row; |
|||
var parentRowIndex = index; |
|||
var childTableId = 'child_table_'+index; |
|||
var childFormTableId = 'child_form_table_'+index; |
|||
var childTableFormId = 'child_table_form_'+index; |
|||
// $detail.html('<form id="'+childTableFormId+'"><table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table></form>'); |
|||
$detail.html('<table id="'+childTableId+'"></table>'); |
|||
// BOM展示 |
|||
$('#'+childTableId).bootstrapTable({ |
|||
url: ctx + "erp/bom/allLevelList", |
|||
method: 'post', |
|||
sidePagination: "server", |
|||
contentType: "application/x-www-form-urlencoded", |
|||
queryParams : { |
|||
parentId: parentRow.bomId |
|||
}, |
|||
columns: [{ |
|||
field: 'id', |
|||
title: '主键id', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'level', |
|||
title: '阶层', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(levelDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'bomNo', |
|||
title: 'BOM号', |
|||
formatter:function (value,row,index){ |
|||
if (value == null || value == ''){ |
|||
return '/'; |
|||
}else{ |
|||
return value |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'materialNo', |
|||
title: '料号', |
|||
formatter: function (value,row,index){ |
|||
var curIndex = parentRowIndex*6+index; |
|||
return '<input readonly class = "form-control" data-id = "id_'+curIndex+'" name="pickDetails['+curIndex+'].materialNo" value="'+value+'"><input class = "hidden form-control" data-id = "id_'+curIndex+'" name="pickDetails['+curIndex+'].bomId" value="'+row.id+'">'; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'photoUrl', |
|||
title: '图片', |
|||
formatter: function(value, row, index) { |
|||
return $.table.imageView(value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'materialName', |
|||
title: '物料名称', |
|||
formatter: function (value,row,index){ |
|||
if (value == null || value == ''){ |
|||
return '/'; |
|||
}else{ |
|||
return value |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'materialType', |
|||
title: '物料类型', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectCategoryLabel(materialTypeDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'describe', |
|||
title: '描述', |
|||
formatter: function (value,row,index){ |
|||
if (value == null || value == ''){ |
|||
return '/'; |
|||
}else{ |
|||
return value |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'brand', |
|||
title: '品牌', |
|||
formatter: function (value,row,index){ |
|||
if (value == null || value == ''){ |
|||
return '/'; |
|||
}else{ |
|||
return value |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'unit', |
|||
title: '单位', |
|||
formatter: function (value,row,index){ |
|||
if (value == null || value == ''){ |
|||
return '/'; |
|||
}else{ |
|||
return value |
|||
} |
|||
} |
|||
}, |
|||
|
|||
{ |
|||
field: 'processMethod', |
|||
title: '加工方式', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(processMethodDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'useNum', |
|||
title: '用量', |
|||
formatter: function (value,row,index){ |
|||
if (value == null || value == ''){ |
|||
return '/'; |
|||
}else{ |
|||
return value |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'lossRate', |
|||
title: '损耗率', |
|||
formatter: function (value,row,index){ |
|||
if (value == null || value == ''){ |
|||
return '/'; |
|||
}else{ |
|||
return value + "%"; |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'materialNum', |
|||
title: '订单用量', |
|||
formatter: function (value,row,index){ |
|||
return parentRow.materialNum * row.useNum; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'pickNum', |
|||
title: '本次领料数量', |
|||
formatter: function (value,row,index){ |
|||
var curIndex = parentRowIndex*6+index; |
|||
return '<input class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum">'; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'parentId', |
|||
title: '父级id', |
|||
visible: false, |
|||
}, |
|||
{ |
|||
field: 'sortNo', |
|||
title: '排序', |
|||
visible: false |
|||
}], |
|||
// 当所有数据被加载时触发 |
|||
onLoadSuccess: function(data) { |
|||
|
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
function queryParams(params) { |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
// pageSize: params.limit, |
|||
// pageNum: params.offset / params.limit + 1, |
|||
// searchValue: params.search, |
|||
// orderByColumn: params.sort, |
|||
// isAsc: params.order |
|||
}; |
|||
// 额外传参 |
|||
curParams.quoteId = $("#saleNo").val(); |
|||
return curParams; |
|||
} |
|||
|
|||
$("#form-makeorder-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
debugger |
|||
var data = $("#form-makeorder-edit").serializeArray(); |
|||
alert(data); |
|||
$.operate.save(ctx + "system/makeorderpick/add", data); |
|||
} |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue