This commit is contained in:
linfso 2024-07-01 17:16:29 +08:00
parent 3df05fa807
commit 9536832a13
4 changed files with 72 additions and 7 deletions

View File

@ -11,8 +11,12 @@
package com.xdadan.erp.web.emis; package com.xdadan.erp.web.emis;
import java.util.Arrays;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.xdadan.erp.emis.utils.WaybillHelper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -29,7 +33,6 @@ import com.xdadan.erp.common.core.controller.BaseController;
import com.xdadan.erp.common.core.domain.AjaxResult; import com.xdadan.erp.common.core.domain.AjaxResult;
import com.xdadan.erp.common.core.page.TableDataInfo; import com.xdadan.erp.common.core.page.TableDataInfo;
import com.xdadan.erp.common.enums.BusinessType; import com.xdadan.erp.common.enums.BusinessType;
import com.xdadan.erp.common.utils.StringUtils;
import com.xdadan.erp.common.utils.poi.ExcelUtil; import com.xdadan.erp.common.utils.poi.ExcelUtil;
import com.xdadan.erp.emis.domain.EmisWaybillAjustApply; import com.xdadan.erp.emis.domain.EmisWaybillAjustApply;
@ -43,7 +46,7 @@ import com.xdadan.erp.emis.service.IEmisWaybillAjustApplyService;
*/ */
@RestController @RestController
@RequestMapping("/emis/emisWaybillAjustApply") @RequestMapping("/emis/emisWaybillAjustApply")
public class EmisWaybillAjustApplyController extends BaseController public class EmisWaybillAjustApplyController extends EmisBaseController
{ {
@Autowired @Autowired
private IEmisWaybillAjustApplyService emisWaybillAjustApplyService; private IEmisWaybillAjustApplyService emisWaybillAjustApplyService;
@ -56,6 +59,18 @@ public class EmisWaybillAjustApplyController extends BaseController
public TableDataInfo list(EmisWaybillAjustApply emisWaybillAjustApply) public TableDataInfo list(EmisWaybillAjustApply emisWaybillAjustApply)
{ {
startPage(); startPage();
// 设置通用权限查询参数
setPrivParams(emisWaybillAjustApply);
if(!StringUtils.isEmpty(emisWaybillAjustApply.getBillCode())){
emisWaybillAjustApply.setBillCode(WaybillHelper.formatQueryValue(emisWaybillAjustApply.getBillCode()));
String[] billCodeSortList = emisWaybillAjustApply.getBillCode().split(",");
if(billCodeSortList.length>1){
emisWaybillAjustApply.getParams().put("billCodeSortList", Arrays.asList(billCodeSortList));
}
}
List<EmisWaybillAjustApply> list = emisWaybillAjustApplyService.selectEmisWaybillAjustApplyList(emisWaybillAjustApply); List<EmisWaybillAjustApply> list = emisWaybillAjustApplyService.selectEmisWaybillAjustApplyList(emisWaybillAjustApply);
return getDataTable(list); return getDataTable(list);
} }
@ -71,6 +86,7 @@ public class EmisWaybillAjustApplyController extends BaseController
@GetMapping("/checkUnique") @GetMapping("/checkUnique")
public AjaxResult checkUnique(EmisWaybillAjustApply emisWaybillAjustApply) public AjaxResult checkUnique(EmisWaybillAjustApply emisWaybillAjustApply)
{ {
int cnt=emisWaybillAjustApplyService.checkUnique(emisWaybillAjustApply); int cnt=emisWaybillAjustApplyService.checkUnique(emisWaybillAjustApply);
return AjaxResult.success("检查成功",cnt); return AjaxResult.success("检查成功",cnt);
} }

View File

@ -533,8 +533,6 @@ public class EmisWaybillController extends EmisBaseController
{ {
startPage(); startPage();
// 如果单号不为空,则去除其他参数 // 如果单号不为空,则去除其他参数
if(!StringUtils.isEmpty(emisWaybill.getBillCode())){ if(!StringUtils.isEmpty(emisWaybill.getBillCode())){
emisWaybill.setBillCode(WaybillHelper.formatQueryValue(emisWaybill.getBillCode())); emisWaybill.setBillCode(WaybillHelper.formatQueryValue(emisWaybill.getBillCode()));

View File

@ -81,7 +81,6 @@ public class EmisWaybillAjustApply extends BaseEntity
/* 中心审核备注 */ /* 中心审核备注 */
private String centerConfirmNote; private String centerConfirmNote;
// 扩展值 // 扩展值
private String applyTypeName; private String applyTypeName;
private String applyManName; private String applyManName;
@ -95,5 +94,8 @@ public class EmisWaybillAjustApply extends BaseEntity
private String centerConfirmSiteName; private String centerConfirmSiteName;
private String centerConfirmManName; private String centerConfirmManName;
// 扩展参数
private EmisWaybill waybillDetail;
} }

View File

@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xdadan.erp.emis.mapper.EmisWaybillAjustApplyMapper"> <mapper namespace="com.xdadan.erp.emis.mapper.EmisWaybillAjustApplyMapper">
<resultMap type="EmisWaybillAjustApply" id="EmisWaybillAjustApplyResult"> <resultMap type="EmisWaybillAjustApply" id="BaseEmisWaybillAjustApplyResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="billCode" column="bill_code" /> <result property="billCode" column="bill_code" />
<result property="applyType" column="apply_type" /> <result property="applyType" column="apply_type" />
@ -29,6 +29,17 @@
<result property="centerConfirmNote" column="center_confirm_note" /> <result property="centerConfirmNote" column="center_confirm_note" />
</resultMap> </resultMap>
<resultMap type="EmisWaybillAjustApply" extends="BaseEmisWaybillAjustApplyResult" id="EmisWaybillAjustApplyResult" >
<association property="waybillDetail"
column="bill_code"
select="com.xdadan.erp.emis.mapper.EmisWaybillMapper.selectWaybillBaseInfoByBillCode"
fetchType="lazy"
/>
</resultMap>
<sql id="selectEmisWaybillAjustApplyVo"> <sql id="selectEmisWaybillAjustApplyVo">
select id, bill_code, apply_type, apply_man_code, apply_site_code, apply_finance_center_code, apply_date, bl_dest_confirmed, dest_confirm_site_code, dest_confirm_date, dest_confirm_note, dest_confirm_man_code, dest_finance_center_code, old_value, new_value, bl_value_json, apply_memo, bl_center_confirmed, center_confirm_site_code, center_confirm_man_code, center_confirm_date, center_confirm_note, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_waybill_ajust_apply select id, bill_code, apply_type, apply_man_code, apply_site_code, apply_finance_center_code, apply_date, bl_dest_confirmed, dest_confirm_site_code, dest_confirm_date, dest_confirm_note, dest_confirm_man_code, dest_finance_center_code, old_value, new_value, bl_value_json, apply_memo, bl_center_confirmed, center_confirm_site_code, center_confirm_man_code, center_confirm_date, center_confirm_note, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_waybill_ajust_apply
</sql> </sql>
@ -38,7 +49,7 @@
<where> <where>
del_flag='0' del_flag='0'
<if test="id != null "> and id = #{id}</if> <if test="id != null "> and id = #{id}</if>
<if test="billCode != null and billCode != ''"> and bill_code like concat('%', #{billCode}, '%')</if> <if test="billCode != null and billCode != ''"> and ( FIND_IN_SET(`bill_code`,#{billCode}) or bill_code like concat('%', #{billCode}, '%') ) </if>
<if test="applyType != null and applyType != ''"> and apply_type = #{applyType}</if> <if test="applyType != null and applyType != ''"> and apply_type = #{applyType}</if>
<if test="applyManCode != null and applyManCode != ''"> and apply_man_code = #{applyManCode}</if> <if test="applyManCode != null and applyManCode != ''"> and apply_man_code = #{applyManCode}</if>
<if test="applySiteCode != null and applySiteCode != ''"> and apply_site_code = #{applySiteCode}</if> <if test="applySiteCode != null and applySiteCode != ''"> and apply_site_code = #{applySiteCode}</if>
@ -97,7 +108,45 @@
and bl_center_confirmed='2' and bl_center_confirmed='2'
</if> </if>
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and (
apply_site_code in (
SELECT t1.site_code FROM (
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
#{params.privSiteCode} ) pd
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
UNION
SELECT #{params.privSiteCode} FROM dual
)
or
dest_confirm_site_code in (
SELECT t1.site_code FROM (
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
#{params.privSiteCode} ) pd
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
UNION
SELECT #{params.privSiteCode} FROM dual
)
)
</if>
</where> </where>
ORDER BY
<if test="params.orderSnSortList != null and params.orderSnSortList.size >0 ">
FIELD
<foreach collection="params.orderSnSortList" item="item" open="(order_sn," separator="," close=")">
#{item}
</foreach>
,
</if>
<if test="params.billCodeSortList != null and params.billCodeSortList.size >0 ">
FIELD
<foreach collection="params.billCodeSortList" item="item" open="(bill_code," separator="," close=")">
#{item}
</foreach>
,
</if>
order by create_time desc order by create_time desc
</select> </select>