zhangsiqi
1 year ago
11 changed files with 1573 additions and 24 deletions
@ -0,0 +1,144 @@ |
|||||
|
package com.ruoyi.system; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSONArray; |
||||
|
import com.alibaba.fastjson.JSONObject; |
||||
|
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.remind.service.RemindService; |
||||
|
import com.ruoyi.system.domain.SysCustomerQuoteChild; |
||||
|
import com.ruoyi.system.domain.exportDto.SysCustomerDto; |
||||
|
import com.ruoyi.system.service.ISysCustomerOperService; |
||||
|
import com.ruoyi.system.service.ISysCustomerQuoteChildService; |
||||
|
import com.ruoyi.system.service.ISysDictTypeService; |
||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.io.IOException; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 客户报价子表信息Controller |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2022-11-02 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/system/customerQuoteChild") |
||||
|
public class SysCustomerQuoteChildController extends BaseController |
||||
|
{ |
||||
|
private final String prefix = "system/customerQuoteChild"; |
||||
|
|
||||
|
@Autowired |
||||
|
private ISysCustomerQuoteChildService sysCustomerQuoteChildService; |
||||
|
@Autowired |
||||
|
private ISysDictTypeService sysDictTypeService; |
||||
|
@Autowired |
||||
|
private RemindService remindService; |
||||
|
@Autowired |
||||
|
private ISysCustomerOperService sysCustomerOperService; |
||||
|
|
||||
|
@RequiresPermissions("system:customerQuoteChild:view") |
||||
|
@GetMapping() |
||||
|
public String customerQoute() |
||||
|
{ |
||||
|
return prefix + "/customerQuoteChild"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询客户报价子表信息列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:customerQuoteChild:list") |
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(SysCustomerQuoteChild sysCustomerQoute) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<SysCustomerQuoteChild> list = sysCustomerQuoteChildService.selectSysCustomerQuoteChildList(sysCustomerQoute); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 新增客户报价子表信息 |
||||
|
*/ |
||||
|
@GetMapping("/add") |
||||
|
public String add() |
||||
|
{ |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存客户报价子表信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:customerQuoteChild:add") |
||||
|
@Log(title = "客户报价子表信息", businessType = BusinessType.INSERT) |
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public AjaxResult addSave(SysCustomerQuoteChild sysCustomerQuoteChild) |
||||
|
{ |
||||
|
return toAjax(sysCustomerQuoteChildService.insertSysCustomerQuoteChild(sysCustomerQuoteChild)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
// /**
|
||||
|
// * 修改客户报价子表信息
|
||||
|
// */
|
||||
|
// @GetMapping("/edit/{id}")
|
||||
|
// public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||
|
// {
|
||||
|
// SysCustomerQuoteChild sysCustomerQuoteChild = sysCustomerQuoteChildService.selectSysCustomerQuoteChildById(id);
|
||||
|
// mmap.put("sysCustomerQuoteChild", sysCustomerQuoteChild);
|
||||
|
// return prefix + "/edit";
|
||||
|
// }
|
||||
|
/** |
||||
|
* 修改保存客户报价子表信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:customer:edit") |
||||
|
@Log(title = "客户报价子表信息", businessType = BusinessType.UPDATE) |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public AjaxResult editSave(SysCustomerQuoteChild sysCustomerQuoteChild) |
||||
|
{ |
||||
|
//审核客户表
|
||||
|
return toAjax(sysCustomerQuoteChildService.updateSysCustomerQuoteChild(sysCustomerQuoteChild)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除客户报价子表信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:customerQuoteChild:remove") |
||||
|
@Log(title = "客户报价子表信息", businessType = BusinessType.DELETE) |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public AjaxResult remove(String[] ids) |
||||
|
{ |
||||
|
return toAjax(sysCustomerQuoteChildService.deleteSysCustomerQuoteChildByIds(ids)); |
||||
|
} |
||||
|
|
||||
|
//查找客户代码和名称
|
||||
|
@PostMapping( "/getcode") |
||||
|
@ResponseBody |
||||
|
public List code(){ |
||||
|
List list= sysCustomerQuoteChildService.selectSysCustomerQuoteChildBycode(); |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
@RequiresPermissions("system:customerQuoteChild:export") |
||||
|
@Log(title = "客户报价子表信息", businessType = BusinessType.EXPORT) |
||||
|
@RequestMapping("/exportCustomerInfo") |
||||
|
@ResponseBody |
||||
|
public void exportCustomerInfo(@RequestBody String selectData, HttpServletResponse response) throws IOException { |
||||
|
//数据处理
|
||||
|
JSONObject jsonObject = (JSONObject) JSONObject.parse(selectData); |
||||
|
JSONArray jsonArray = jsonObject.getJSONArray("selectData"); |
||||
|
List<SysCustomerDto> selectDataList = JSONObject.parseArray(String.valueOf(jsonArray), SysCustomerDto.class); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,45 @@ |
|||||
|
package com.ruoyi.system.domain; |
||||
|
|
||||
|
import com.ruoyi.common.core.domain.BaseEntity; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
//客户报价 - 子表
|
||||
|
public class SysCustomerQuoteChild extends BaseEntity { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
private Long id; |
||||
|
//物料表中的id
|
||||
|
private Long materialId; |
||||
|
//物料编号
|
||||
|
private String materialCode; |
||||
|
//物料名称
|
||||
|
private String materialName; |
||||
|
//物料的类型
|
||||
|
private String mateialType; |
||||
|
//物料的数量
|
||||
|
private String materialNum; |
||||
|
//国内税率
|
||||
|
private Double countaxRate; |
||||
|
//美元汇率
|
||||
|
private Double usdTax; |
||||
|
//物料的不含税单价(RMB)
|
||||
|
private Double materialNoRmb; |
||||
|
//物料的含税单价(RMB)
|
||||
|
private Double materialRmb; |
||||
|
//物料的不含税单价(USD)
|
||||
|
private Double materialNoUsd; |
||||
|
//物料的含税单价(USD)
|
||||
|
private Double materialUsd; |
||||
|
//创建人
|
||||
|
private String createBy; |
||||
|
//创建时间
|
||||
|
private Date createTime; |
||||
|
//修改人
|
||||
|
private String updateBy; |
||||
|
//修改时间
|
||||
|
private Date updateTime; |
||||
|
//审核标志
|
||||
|
private String deginFlag; |
||||
|
//删除标志
|
||||
|
private String delFlag; |
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
package com.ruoyi.system.mapper; |
||||
|
|
||||
|
import com.ruoyi.system.domain.SysCustomerQuoteChild; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 客户报价子表信息Mapper接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2022-11-02 |
||||
|
*/ |
||||
|
public interface SysCustomerQuoteChildMapper |
||||
|
{ |
||||
|
/** |
||||
|
* 查询客户报价子表信息 |
||||
|
* |
||||
|
* @param id 客户报价子表信息ID |
||||
|
* @return 客户报价子表信息 |
||||
|
*/ |
||||
|
|
||||
|
SysCustomerQuoteChild selectSysCustomerQuoteChildById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询客户报价信息列表 |
||||
|
* |
||||
|
* @param sysCustomerQuoteChild 客户报价子表信息 |
||||
|
* @return 客户报价子表信息集合 |
||||
|
*/ |
||||
|
List<SysCustomerQuoteChild> selectSysCustomerQuoteChildList(SysCustomerQuoteChild sysCustomerQuoteChild); |
||||
|
|
||||
|
/** |
||||
|
* 新增客户报价子表信息 |
||||
|
* |
||||
|
* @param sysCustomerQuoteChild 客户报价信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int insertSysCustomerQuoteChild(SysCustomerQuoteChild sysCustomerQuoteChild); |
||||
|
|
||||
|
/** |
||||
|
* 修改客户报价子表信息 |
||||
|
* |
||||
|
* @param sysCustomerQuoteChild 客户报价信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int updateSysCustomerQuoteChild(SysCustomerQuoteChild sysCustomerQuoteChild); |
||||
|
|
||||
|
/** |
||||
|
* 删除客户报价子表信息 |
||||
|
* |
||||
|
* @param id 客户报价子表信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int deleteSysCustomerQuoteChildById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除客户报价子表信息 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int deleteSysCustomerQuoteChildByIds(String[] ids); |
||||
|
|
||||
|
|
||||
|
List selectSysCustomerQuoteChildBycode(); |
||||
|
|
||||
|
SysCustomerQuoteChild selectSysCustomerByMaterialCode(String materialCode); |
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
package com.ruoyi.system.service; |
||||
|
|
||||
|
import com.ruoyi.system.domain.SysCustomerQuoteChild; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 客户报价子表信息Mapper接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2022-11-02 |
||||
|
*/ |
||||
|
public interface ISysCustomerQuoteChildService |
||||
|
{ |
||||
|
/** |
||||
|
* 查询客户报价子表信息 |
||||
|
* |
||||
|
* @param id 客户报价子表信息ID |
||||
|
* @return 客户报价子表信息 |
||||
|
*/ |
||||
|
|
||||
|
SysCustomerQuoteChild selectSysCustomerQuoteChildById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询客户报价信息列表 |
||||
|
* |
||||
|
* @param sysCustomerQuoteChild 客户报价子表信息 |
||||
|
* @return 客户报价子表信息集合 |
||||
|
*/ |
||||
|
List<SysCustomerQuoteChild> selectSysCustomerQuoteChildList(SysCustomerQuoteChild sysCustomerQuoteChild); |
||||
|
|
||||
|
/** |
||||
|
* 新增客户报价子表信息 |
||||
|
* |
||||
|
* @param sysCustomerQuoteChild 客户报价信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int insertSysCustomerQuoteChild(SysCustomerQuoteChild sysCustomerQuoteChild); |
||||
|
|
||||
|
/** |
||||
|
* 修改客户报价子表信息 |
||||
|
* |
||||
|
* @param sysCustomerQuoteChild 客户报价信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int updateSysCustomerQuoteChild(SysCustomerQuoteChild sysCustomerQuoteChild); |
||||
|
|
||||
|
/** |
||||
|
* 删除客户报价子表信息 |
||||
|
* |
||||
|
* @param id 客户报价子表信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int deleteSysCustomerQuoteChildById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除客户报价子表信息 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int deleteSysCustomerQuoteChildByIds(String[] ids); |
||||
|
|
||||
|
|
||||
|
List selectSysCustomerQuoteChildBycode(); |
||||
|
|
||||
|
SysCustomerQuoteChild selectSysCustomerByMaterialCode(String customerCode); |
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
package com.ruoyi.system.service.impl; |
||||
|
|
||||
|
import com.ruoyi.system.domain.SysCustomerQuoteChild; |
||||
|
import com.ruoyi.system.mapper.SysCustomerQuoteChildMapper; |
||||
|
import com.ruoyi.system.service.ISysCustomerQuoteChildService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
@Service |
||||
|
public class SysCustomerQuoteChildServiceImpl implements ISysCustomerQuoteChildService { |
||||
|
@Autowired |
||||
|
private SysCustomerQuoteChildMapper sysCustomerQuoteChildMapper; |
||||
|
@Override |
||||
|
public SysCustomerQuoteChild selectSysCustomerQuoteChildById(Long id) { |
||||
|
return sysCustomerQuoteChildMapper.selectSysCustomerQuoteChildById(id); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<SysCustomerQuoteChild> selectSysCustomerQuoteChildList(SysCustomerQuoteChild sysCustomerQuoteChild) { |
||||
|
return sysCustomerQuoteChildMapper.selectSysCustomerQuoteChildList(sysCustomerQuoteChild); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public int insertSysCustomerQuoteChild(SysCustomerQuoteChild sysCustomerQuoteChild) { |
||||
|
return sysCustomerQuoteChildMapper.insertSysCustomerQuoteChild(sysCustomerQuoteChild); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public int updateSysCustomerQuoteChild(SysCustomerQuoteChild sysCustomerQuoteChild) { |
||||
|
return sysCustomerQuoteChildMapper.updateSysCustomerQuoteChild(sysCustomerQuoteChild); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public int deleteSysCustomerQuoteChildById(Long id) { |
||||
|
return sysCustomerQuoteChildMapper.deleteSysCustomerQuoteChildById(id); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public int deleteSysCustomerQuoteChildByIds(String[] ids) { |
||||
|
return sysCustomerQuoteChildMapper.deleteSysCustomerQuoteChildByIds(ids); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List selectSysCustomerQuoteChildBycode() { |
||||
|
return sysCustomerQuoteChildMapper.selectSysCustomerQuoteChildBycode(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public SysCustomerQuoteChild selectSysCustomerByMaterialCode(String materialCode) { |
||||
|
return sysCustomerQuoteChildMapper.selectSysCustomerByMaterialCode(materialCode); |
||||
|
} |
||||
|
} |
@ -0,0 +1,149 @@ |
|||||
|
<?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.SysCustomerQuoteChildMapper"> |
||||
|
|
||||
|
<resultMap type="SysCustomerQuoteChild" id="SysCustomerQuoteChildResult"> |
||||
|
<result property="id" column="id" /> |
||||
|
<result property="materialId" column="materialId" /> |
||||
|
<result property="materialCode" column="materialCode" /> |
||||
|
<result property="materialName" column="materialName" /> |
||||
|
<result property="materialType" column="materialType" /> |
||||
|
<result property="materilaNum" column="materialNum" /> |
||||
|
<result property="countaxRate" column="countaxRate" /> |
||||
|
<result property="usdTax" column="usdTax" /> |
||||
|
<result property="materialNoRmb" column="materialNoRmb" /> |
||||
|
<result property="materialRmb" column="materialRmb" /> |
||||
|
<result property="materialNoUsd" column="materialNoUsd" /> |
||||
|
<result property="materialUsd" column="materialUsd" /> |
||||
|
<result property="degin_flag" column="deginFlag" /> |
||||
|
<result property="del_flag" column="delFlag" /> |
||||
|
<result property="create_by" column="createBy" /> |
||||
|
<result property="create_time" column="createTime" /> |
||||
|
<result property="update_by" column="updateBy" /> |
||||
|
<result property="update_time" column="updateTime" /> |
||||
|
<result property="remark" column="remark" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="selectSysCustomerQuoteVo"> |
||||
|
select id,materialId,materialCode,materialName,materialType,materialNum,countTax,usdTax,materialNoRmb,materialRmb,materialNoUsd,materialUsd,degin_flag,del_flag,create_by,create_time,update_by,update_time,remark from sys_customer_quoteChild |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectSysCustomerQuoteChildList" parameterType="SysCustomerQuoChild" resultMap="SysCustomerQuoteChildResult"> |
||||
|
<include refid="selectSysCustomerQuoteChildVo"/> |
||||
|
<where> |
||||
|
<if test="materialCode != null and materialCode != ''"> and materialCode like concat('%', #{materialCode}, '%')</if> |
||||
|
<if test="material != null and materialName != ''"> and materialName like concat('%', #{materialName}, '%')</if> |
||||
|
<if test="materialType != null and materialType != ''"> and materialType = #{materialType}</if> |
||||
|
<if test="countTax != null and countTax != ''"> and countTax like concat('%', #{countTax}, '%')</if> |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectSysCustomerQuoteChildById" parameterType="Long" resultMap="SysCustomerQuoteChildResult"> |
||||
|
<include refid="selectSysCustomerQuoteChildVo"/> |
||||
|
where id = #{id} |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectSysCustomerByQuoteChildCode" resultMap="SysCustomerQuoteChildResult"> |
||||
|
select materialCode,materialName from sys_customer_quoteChild |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectSysCustomerByMaterialCode" parameterType="String" resultMap="SysCustomerQuoteChildResult"> |
||||
|
<include refid="selectSysCustomerQuoteChildVo"/> |
||||
|
where materialCode = #{materialCode} |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
<insert id="insertSysCustomerQuoteChild" parameterType="SysCustomerQuoteChild" useGeneratedKeys="true" keyProperty="id"> |
||||
|
insert into sys_customer_quoteChild |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="materialId != null and materialId != ''" >materialId,</if> |
||||
|
<if test="materialCode != null and materialCode != ''" >materialCode,</if> |
||||
|
<if test="materialName != null and materialName ! =''">materialName,</if> |
||||
|
<if test="materialType != null and materialType != ''" >materialType,</if> |
||||
|
<if test="materialNum != null" >materialNum,</if> |
||||
|
<if test="countTax =null" >countTax,</if> |
||||
|
<if test="usdTax != null" >usdTax,</if> |
||||
|
<if test="materialNoRmbNum != null" >materialNoRmbNum,</if> |
||||
|
<if test="materialRmbNum != null">materialRmbNum,</if> |
||||
|
<if test="materialNoRmbSum != null">materialNoRmbSum,</if> |
||||
|
<if test="materialRmbSum != null">materialRmbSum,</if> |
||||
|
<if test="materialNoUsdNum != null">materialNoUsdNum,</if> |
||||
|
<if test="materialUsdNum != null">materialUsdNum,</if> |
||||
|
<if test="materialNoUsdSum != null">materialNoUsdSum,</if> |
||||
|
<if test="materialUsdSum != null">materialUsdSum,</if> |
||||
|
<if test="creatBy != null and createBy != ''" >create_by,</if> |
||||
|
<if test="updateBy != null and updateBy != ''" >update_by,</if> |
||||
|
<if test="updateTime != null and updateTime != ''" >update_time,</if> |
||||
|
<if test="remark != null and remark != ''" >remark,</if> |
||||
|
degin_flag, |
||||
|
del_flag, |
||||
|
create_time, |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="materialId != null and materialId != ''" >#{materialId},</if> |
||||
|
<if test="materialCode != null and materialCode != ''" >#{materialCode},</if> |
||||
|
<if test="materialName != null and materialName ! =''">#{materialName},</if> |
||||
|
<if test="materialType != null and materialType != ''" >#{materialType},</if> |
||||
|
<if test="materialNum != null" >#{materialNum},</if> |
||||
|
<if test="countTax =null" >#{countTax},</if> |
||||
|
<if test="usdTax != null" >#{usdTax},</if> |
||||
|
<if test="materialNoRmb != null" >#{materialNoRmb},</if> |
||||
|
<if test="materialRmb != null">#{materialRmb},</if> |
||||
|
<if test="materialNoRmbSum != null">#{materialNoRmbSum},</if> |
||||
|
<if test="materialRmbSum != null">#{materialRmbSum},</if> |
||||
|
<if test="materialNoUsd != null">#{materialNoUsd},</if> |
||||
|
<if test="materialNoUsdSum != null">#{materialNoUsdSum},</if> |
||||
|
<if test="materialUsd != null">#{materialUsd},</if> |
||||
|
<if test="materialUsdSum != null">#{materialUsdSum},</if> |
||||
|
<if test="creatBy != null and createBy != ''" >#{createBy},</if> |
||||
|
<if test="updateBy != null and updateBy != ''" >#{updateBy},</if> |
||||
|
<if test="updateTime != null and updateTime != ''" >#{updateTime},</if> |
||||
|
<if test="remark != null and remark != ''" >#{remark},</if> |
||||
|
0, |
||||
|
0, |
||||
|
now(), |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updateSysCustomerQuoteChild" parameterType="SysCustomerQuoteChild"> |
||||
|
update sys_customer_quoteChild |
||||
|
<trim prefix="SET" suffixOverrides=","> |
||||
|
<if test="materialId != null and materialId != ''" > materialId = #{materialId},</if> |
||||
|
<if test="materialCode != null and materialCode != ''" >materialCode = #{materialCode},</if> |
||||
|
<if test="materialName != null and materialName ! =''">materialName = #{materialName},</if> |
||||
|
<if test="materialType != null and materialType != ''" >materialType = #{materialType},</if> |
||||
|
<if test="materialNum != null" >materialNum = #{materialNum},</if> |
||||
|
<if test="countTax =null" >countTax = #{countTax},</if> |
||||
|
<if test="usdTax != null" >usdTax = #{usdTax},</if> |
||||
|
<if test="materialNoRmb != null" >materialNoRmb = #{materialNoRmb},</if> |
||||
|
<if test="materialRmb != null">materialRmb#{materialRmb},</if> |
||||
|
<if test="materialNoRmbSum != null">materialNoRmbSum = #{materialNoRmbSum},</if> |
||||
|
<if test="materialRmbSum != null">materialRmbSum = #{materialRmbSum},</if> |
||||
|
<if test="materialNoUsd != null">materialNoUsd = #{materialNoUsd},</if> |
||||
|
<if test="materialNoUsdSum != null">materialNoUsdSum = #{materialNoUsdSum},</if> |
||||
|
<if test="materialUsd != null">materialUsd = #{materialUsd},</if> |
||||
|
<if test="materialUsdSum != null">materialUsdSum = #{materialUsdSum},</if> |
||||
|
<if test="creatBy != null and createBy != ''" >create_by = #{createBy},</if> |
||||
|
<if test="updateBy != null and updateBy != ''" >update_by = #{updateBy},</if> |
||||
|
<if test="updateTime != null and updateTime != ''" >update_time = #{updateTime},</if> |
||||
|
<if test="remark != null and remark != ''" >remark = #{remark},</if> |
||||
|
<if test="deginFLag != null and deginFlag != ''" >degin_flag = #{deginFlag},</if> |
||||
|
<if test="delFlag != null and delFlag != ''" >del_flag = #{delFlag},</if> |
||||
|
update_time = CONCAT_WS(',',NOW(),update_time), |
||||
|
</trim> |
||||
|
where id = #{id} |
||||
|
</update> |
||||
|
<delete id="deleteSysCustomerQuoteChildById" parameterType="Long"> |
||||
|
delete from sys_customer_quoteChild where id = #{id} |
||||
|
</delete> |
||||
|
|
||||
|
<delete id="deleteSysCustomerQuoteChildByIds" parameterType="String"> |
||||
|
delete from sys_customer_quoteChild where id in |
||||
|
<foreach item="id" collection="array" open="(" separator="," close=")"> |
||||
|
#{id} |
||||
|
</foreach> |
||||
|
</delete> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,272 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
||||
|
<head> |
||||
|
<th:block th:include="include :: header('物料信息详情')" /> |
||||
|
<th:block th:include="include :: select2-css" /> |
||||
|
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/> |
||||
|
</head> |
||||
|
<body class="white-bg"> |
||||
|
<div id="app" class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal m" id="form-material-edit" th:object="${erpMaterial}"> |
||||
|
<input name="id" th:field="*{id}" type="hidden"> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">料号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input id="materialNo" name="materialNo" th:field="*{materialNo}" 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 name="materialName" th:field="*{materialName}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">审核状态:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<div class="radio-box" th:each="dict : ${@dict.getType('auditStatus')}"> |
||||
|
<input type="radio" th:id="${'auditStatus_' + dict.dictCode}" name="auditStatus" th:value="${dict.dictValue}" th:field="*{auditStatus}"> |
||||
|
<label th:for="${'auditStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">使用状态:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<div class="radio-box" th:each="dict : ${@dict.getType('useStatus')}"> |
||||
|
<input type="radio" th:id="${'useStatus_' + dict.dictCode}" name="useStatus" th:value="${dict.dictValue}" th:field="*{useStatus}"> |
||||
|
<label th:for="${'useStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">是否有生产团队:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="havaProductTem" th:field="*{havaProductTem}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">物料类型:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}"> |
||||
|
<optgroup> |
||||
|
<option value="">请选择</option> |
||||
|
</optgroup> |
||||
|
<optgroup th:each="child: ${childList}" th:label="${child.name}"> |
||||
|
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option> |
||||
|
</optgroup> |
||||
|
</select> |
||||
|
</div> |
||||
|
<input type="text" id="materialType" name="materialType" th:field="*{materialType}" hidden /> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">加工方式:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}"> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">单位:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}"> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">品牌:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="brand" th:field="*{brand}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">描述:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="describe" class="form-control">[[*{describe}]]</textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">入库部门:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="warehouseDept" class="form-control m-b" th:with="type=${@dict.getType('warehouseDept')}"> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseDept}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">照片:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<el-upload |
||||
|
:action="fileUploadUrl" |
||||
|
:on-success="uploadSuccess" |
||||
|
:on-remove="uploadRemove" |
||||
|
:file-list="fileList" |
||||
|
list-type="picture" |
||||
|
accept=".jpg,.png" |
||||
|
multiple> |
||||
|
<el-button size="small" type="primary">点击上传</el-button> |
||||
|
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,第一张图片为主图</div> |
||||
|
</el-upload> |
||||
|
</div> |
||||
|
<input id="photoAttachId" name = "photoAttachId" hidden th:field="*{photoAttachId}"> |
||||
|
<input id="fileIdStr" type="text" name="fileIdStr" th:field="*{fileIdStr}" hidden> |
||||
|
<input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: select2-js" /> |
||||
|
<script th:src="@{/ajax/libs/vue/vue.js}"></script> |
||||
|
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script> |
||||
|
<script type="text/javascript"> |
||||
|
new Vue({ |
||||
|
el: '#app', |
||||
|
data: function() { |
||||
|
return { |
||||
|
fileList: [], |
||||
|
fileUploadUrl: ctx + "common/uploadSingleFile", |
||||
|
fileDeleteUrl: ctx + "common/deleteFile", |
||||
|
getListByAttachIdUrl: ctx + "system/attach/file/getListByAttachId", |
||||
|
fileIdList:[], |
||||
|
removeFileIdList:[], |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
|
||||
|
// 控制下拉框选中 |
||||
|
var materialType = $("#materialType").val(); |
||||
|
$("#selectMaterialType").val(materialType).trigger("change"); |
||||
|
|
||||
|
var that = this; |
||||
|
// 页面渲染完成,可以执行需要的操作 |
||||
|
console.log('页面已渲染完成'); |
||||
|
console.log($("#id").val()); |
||||
|
console.log($("#photoAttachId").val()); |
||||
|
var attachId = $("#photoAttachId").val(); |
||||
|
if(attachId){ |
||||
|
$.ajax({ |
||||
|
type: "get", |
||||
|
url: that.getListByAttachIdUrl, |
||||
|
data: {attachId:attachId}, |
||||
|
cache: false, |
||||
|
async: false, // 设置成同步 |
||||
|
dataType: 'json', |
||||
|
success: function(result) { |
||||
|
if (result.code == web_status.SUCCESS) { |
||||
|
result.data.forEach((item) => { |
||||
|
that.fileIdList.push(item.id); |
||||
|
that.fileList.push({name: item.name, url: item.url, attachFileId: item.id,isBind:true}); |
||||
|
}); |
||||
|
} else { |
||||
|
$.modal.msgError(result.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function(error) { |
||||
|
$.modal.msgError("获取附件失败。"); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
uploadSuccess(response, file, fileList) { |
||||
|
console.log(response); |
||||
|
if(response.code == web_status.SUCCESS){ |
||||
|
var attachFileId = response.data.id; |
||||
|
file.attachFileId = attachFileId; |
||||
|
file.isBind = false; |
||||
|
this.fileIdList.push(attachFileId); |
||||
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
||||
|
$.modal.msgSuccess("上传成功"); |
||||
|
}else{ |
||||
|
$.modal.alertError(response.msg); |
||||
|
} |
||||
|
}, |
||||
|
uploadRemove(file, fileList) { |
||||
|
console.log(file, fileList); |
||||
|
var attachFileId = file.attachFileId; |
||||
|
var isBind = file.isBind; |
||||
|
if(isBind==false){ |
||||
|
$.ajax({ |
||||
|
type: "get", |
||||
|
url: this.fileDeleteUrl, |
||||
|
data: {id:attachFileId}, |
||||
|
cache: false, |
||||
|
async: false, // 设置成同步 |
||||
|
dataType: 'json', |
||||
|
success: function(result) { |
||||
|
if (result.code == web_status.SUCCESS) { |
||||
|
var index = this.fileIdList.indexOf(attachFileId); |
||||
|
if(index!=-1){ |
||||
|
this.fileIdList.splice(index,1); |
||||
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
||||
|
} |
||||
|
$.modal.msgSuccess("删除附件成功。"); |
||||
|
} else { |
||||
|
$.modal.alertError(result.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function(error) { |
||||
|
$.modal.alertError("删除附件失败。"); |
||||
|
} |
||||
|
}); |
||||
|
}else{ |
||||
|
var index = this.fileIdList.indexOf(attachFileId); |
||||
|
if(index!=-1){ |
||||
|
this.fileIdList.splice(index,1); |
||||
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
||||
|
// 保存的时候才删除 |
||||
|
this.removeFileIdList.push(attachFileId); |
||||
|
$("#removeFileIdStr").val(this.removeFileIdList.join(";")); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
var prefix = ctx + "erp/material"; |
||||
|
$("#form-material-edit").validate({ |
||||
|
onkeyup: false, |
||||
|
rules:{ |
||||
|
materialNo:{ |
||||
|
isInteger: true, |
||||
|
minlength: 10, |
||||
|
maxlength: 10, |
||||
|
remote: { |
||||
|
url: prefix + "/checkMaterialNoUnique", |
||||
|
type: "post", |
||||
|
dataType: "json", |
||||
|
data: { |
||||
|
"materialNo": function() { |
||||
|
console.log($("#materialNo").val()) |
||||
|
return $.common.trim($("#materialNo").val()); |
||||
|
} |
||||
|
}, |
||||
|
dataFilter: function(data, type) { |
||||
|
return $.validate.unique(data); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
messages: { |
||||
|
"materialNo": { |
||||
|
remote: "料号已经存在", |
||||
|
minlength: "请输入10位整数", |
||||
|
maxlength: "请输入10位整数", |
||||
|
}, |
||||
|
}, |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
var materialType = $('#selectMaterialType').select2('val'); |
||||
|
$('#materialType').val(materialType); |
||||
|
$.operate.save(prefix + "/edit", $('#form-material-edit').serialize()); |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
Loading…
Reference in new issue