Merge remote-tracking branch 'origin/master'

highway
wws 1 year ago
commit a0e42c4565

@ -311,10 +311,10 @@
-- Where -- Where
<!-- <if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>--> <!-- <if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>-->
-- bbc.product_code = right(bpc1.product_code,11) -- bbc.product_code = right(bpc1.product_code,11)
select distinct bbc.bom_code,bpc1.product_desc_zh,right(bpc1.product_code,11) as pc,bbc.product_code select distinct bbc.bom_code,bp.product_desc_zh,right(bp.product_code,11) as pc,bbc.product_code
from base_bom_component bbc,base_product_copy1 bpc1 from base_bom_component bbc,base_product bp
Where Where
bbc.product_code = right(bpc1.product_code,11) bbc.product_code = right(bp.product_code,11)
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if> <if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>
</select> </select>

@ -2,6 +2,10 @@ package com.op.wms.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -61,7 +65,7 @@ public class SysCustomerController extends BaseController {
*/ */
@RequiresPermissions("wms:customer:query") @RequiresPermissions("wms:customer:query")
@GetMapping(value = "/{clientId}") @GetMapping(value = "/{clientId}")
public AjaxResult getInfo(@PathVariable("clientId") Long clientId) { public AjaxResult getInfo(@PathVariable("clientId") String clientId) {
return success(sysCustomerService.selectSysCustomerByClientId(clientId)); return success(sysCustomerService.selectSysCustomerByClientId(clientId));
} }
@ -72,7 +76,16 @@ public class SysCustomerController extends BaseController {
@Log(title = "客户管理", businessType = BusinessType.INSERT) @Log(title = "客户管理", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody SysCustomer sysCustomer) { public AjaxResult add(@RequestBody SysCustomer sysCustomer) {
return toAjax(sysCustomerService.insertSysCustomer(sysCustomer)); sysCustomer.setClientId(IdUtils.fastSimpleUUID());
sysCustomer.setCreateBy(SecurityUtils.getUsername());
sysCustomer.setCreateTime(DateUtils.getNowDate());
if (sysCustomerService.checkClientCodeUnique(sysCustomer)) {
return AjaxResult.error("组织编码已存在!");
}else if(sysCustomerService.checkClientNameUnique(sysCustomer)){
return AjaxResult.error("组织名称已存在!");
}else{
return toAjax(sysCustomerService.insertSysCustomer(sysCustomer));
}
} }
/** /**
@ -82,6 +95,8 @@ public class SysCustomerController extends BaseController {
@Log(title = "客户管理", businessType = BusinessType.UPDATE) @Log(title = "客户管理", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody SysCustomer sysCustomer) { public AjaxResult edit(@RequestBody SysCustomer sysCustomer) {
sysCustomer.setUpdateBy(SecurityUtils.getUsername());
sysCustomer.setUpdateTime(DateUtils.getNowDate());
return toAjax(sysCustomerService.updateSysCustomer(sysCustomer)); return toAjax(sysCustomerService.updateSysCustomer(sysCustomer));
} }
@ -91,7 +106,7 @@ public class SysCustomerController extends BaseController {
@RequiresPermissions("wms:customer:remove") @RequiresPermissions("wms:customer:remove")
@Log(title = "客户管理", businessType = BusinessType.DELETE) @Log(title = "客户管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{clientIds}") @DeleteMapping("/{clientIds}")
public AjaxResult remove(@PathVariable Long[] clientIds) { public AjaxResult remove(@PathVariable String[] clientIds) {
return toAjax(sysCustomerService.deleteSysCustomerByClientIds(clientIds)); return toAjax(sysCustomerService.deleteSysCustomerByClientIds(clientIds));
} }
} }

@ -15,7 +15,7 @@ public class SysCustomer extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 客户ID */ /** 客户ID */
private Long clientId; private String clientId;
/** 客户编码 */ /** 客户编码 */
@Excel(name = "客户编码") @Excel(name = "客户编码")
@ -109,11 +109,11 @@ public class SysCustomer extends BaseEntity {
@Excel(name = "预留字段4") @Excel(name = "预留字段4")
private Long attr4; private Long attr4;
public void setClientId(Long clientId) { public void setClientId(String clientId) {
this.clientId = clientId; this.clientId = clientId;
} }
public Long getClientId() { public String getClientId() {
return clientId; return clientId;
} }
public void setClientCode(String clientCode) { public void setClientCode(String clientCode) {

@ -17,7 +17,7 @@ public interface SysCustomerMapper {
* @param clientId * @param clientId
* @return * @return
*/ */
public SysCustomer selectSysCustomerByClientId(Long clientId); public SysCustomer selectSysCustomerByClientId(String clientId);
/** /**
* *
@ -49,7 +49,7 @@ public interface SysCustomerMapper {
* @param clientId * @param clientId
* @return * @return
*/ */
public int deleteSysCustomerByClientId(Long clientId); public int deleteSysCustomerByClientId(String clientId);
/** /**
* *
@ -57,5 +57,8 @@ public interface SysCustomerMapper {
* @param clientIds * @param clientIds
* @return * @return
*/ */
public int deleteSysCustomerByClientIds(Long[] clientIds); public int deleteSysCustomerByClientIds(String[] clientIds);
String checkClientCodeUnique(SysCustomer sysCustomer);
String checkClientNameUnique(SysCustomer sysCustomer);
} }

@ -16,7 +16,7 @@ public interface ISysCustomerService {
* @param clientId * @param clientId
* @return * @return
*/ */
public SysCustomer selectSysCustomerByClientId(Long clientId); public SysCustomer selectSysCustomerByClientId(String clientId);
/** /**
* *
@ -48,7 +48,7 @@ public interface ISysCustomerService {
* @param clientIds * @param clientIds
* @return * @return
*/ */
public int deleteSysCustomerByClientIds(Long[] clientIds); public int deleteSysCustomerByClientIds(String[] clientIds);
/** /**
* *
@ -56,5 +56,9 @@ public interface ISysCustomerService {
* @param clientId * @param clientId
* @return * @return
*/ */
public int deleteSysCustomerByClientId(Long clientId); public int deleteSysCustomerByClientId(String clientId);
//增加校验
boolean checkClientCodeUnique(SysCustomer sysCustomer);
boolean checkClientNameUnique(SysCustomer sysCustomer);
} }

@ -5,6 +5,7 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.DateUtils;
import com.op.common.security.utils.SecurityUtils; import com.op.common.security.utils.SecurityUtils;
import com.op.wms.domain.SysFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.op.wms.mapper.SysCustomerMapper; import com.op.wms.mapper.SysCustomerMapper;
@ -30,7 +31,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService {
*/ */
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public SysCustomer selectSysCustomerByClientId(Long clientId) { public SysCustomer selectSysCustomerByClientId(String clientId) {
return sysCustomerMapper.selectSysCustomerByClientId(clientId); return sysCustomerMapper.selectSysCustomerByClientId(clientId);
} }
@ -82,7 +83,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService {
*/ */
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public int deleteSysCustomerByClientIds(Long[] clientIds) { public int deleteSysCustomerByClientIds(String[] clientIds) {
return sysCustomerMapper.deleteSysCustomerByClientIds(clientIds); return sysCustomerMapper.deleteSysCustomerByClientIds(clientIds);
} }
@ -94,7 +95,39 @@ public class SysCustomerServiceImpl implements ISysCustomerService {
*/ */
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public int deleteSysCustomerByClientId(Long clientId) { public int deleteSysCustomerByClientId(String clientId) {
return sysCustomerMapper.deleteSysCustomerByClientId(clientId); return sysCustomerMapper.deleteSysCustomerByClientId(clientId);
} }
/**
*
*
* @return
*/
@Override
@DS("#header.poolName")
public boolean checkClientCodeUnique(SysCustomer sysCustomer) {
String code = sysCustomerMapper.checkClientCodeUnique(sysCustomer);
if(code == null){
return false;
}else{
return true;
}
}
/**
*
*
* @return
*/
@Override
@DS("#header.poolName")
public boolean checkClientNameUnique(SysCustomer sysCustomer) {
String name = sysCustomerMapper.checkClientNameUnique(sysCustomer);
if(name== null){
return false;
}else{
return true;
}
}
} }

@ -43,7 +43,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSysCustomerList" parameterType="SysCustomer" resultMap="SysCustomerResult"> <select id="selectSysCustomerList" parameterType="SysCustomer" resultMap="SysCustomerResult">
<include refid="selectSysCustomerVo"/> <include refid="selectSysCustomerVo"/>
<where> <where>
<if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode}</if> <if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
<if test="clientCode != null and clientCode != ''"> and client_code like concat('%', #{clientCode}, '%')</if>
<if test="clientName != null and clientName != ''"> and client_name like concat('%', #{clientName}, '%')</if> <if test="clientName != null and clientName != ''"> and client_name like concat('%', #{clientName}, '%')</if>
<if test="clientNick != null and clientNick != ''"> and client_nick = #{clientNick}</if> <if test="clientNick != null and clientNick != ''"> and client_nick = #{clientNick}</if>
<if test="clientEn != null and clientEn != ''"> and client_en = #{clientEn}</if> <if test="clientEn != null and clientEn != ''"> and client_en = #{clientEn}</if>
@ -69,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectSysCustomerByClientId" parameterType="Long" resultMap="SysCustomerResult"> <select id="selectSysCustomerByClientId" parameterType="java.lang.String" resultMap="SysCustomerResult">
<include refid="selectSysCustomerVo"/> <include refid="selectSysCustomerVo"/>
where client_id = #{clientId} where client_id = #{clientId}
</select> </select>
@ -77,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertSysCustomer" parameterType="SysCustomer" useGeneratedKeys="true" keyProperty="clientId"> <insert id="insertSysCustomer" parameterType="SysCustomer" useGeneratedKeys="true" keyProperty="clientId">
insert into sys_customer insert into sys_customer
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="clientId != null and clientId != ''">client_id,</if>
<if test="clientCode != null and clientCode != ''">client_code,</if> <if test="clientCode != null and clientCode != ''">client_code,</if>
<if test="clientName != null and clientName != ''">client_name,</if> <if test="clientName != null and clientName != ''">client_name,</if>
<if test="clientNick != null">client_nick,</if> <if test="clientNick != null">client_nick,</if>
@ -107,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clientId != null and clientId != ''">#{clientId},</if>
<if test="clientCode != null and clientCode != ''">#{clientCode},</if> <if test="clientCode != null and clientCode != ''">#{clientCode},</if>
<if test="clientName != null and clientName != ''">#{clientName},</if> <if test="clientName != null and clientName != ''">#{clientName},</if>
<if test="clientNick != null">#{clientNick},</if> <if test="clientNick != null">#{clientNick},</if>
@ -173,7 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where client_id = #{clientId} where client_id = #{clientId}
</update> </update>
<delete id="deleteSysCustomerByClientId" parameterType="Long"> <delete id="deleteSysCustomerByClientId" parameterType="java.lang.String">
delete from sys_customer where client_id = #{clientId} delete from sys_customer where client_id = #{clientId}
</delete> </delete>
@ -183,4 +186,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{clientId} #{clientId}
</foreach> </foreach>
</delete> </delete>
<select id="checkClientCodeUnique" parameterType="SysCustomer" resultType ="java.lang.String">
select client_code
from sys_customer
where client_code = #{clientCode}
</select>
<select id="checkClientNameUnique" parameterType="SysCustomer" resultType ="java.lang.String">
select client_code
from sys_customer
where client_name = #{clientName}
</select>
</mapper> </mapper>
Loading…
Cancel
Save