Merge pull request 'demand: 批量导入线路规则bug修改' (#54) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/54
This commit is contained in:
heyu 2025-06-12 11:44:47 +08:00
commit 44211a8f61
3 changed files with 32 additions and 5 deletions

View File

@ -3,6 +3,7 @@ package com.xdadan.erp.web.emis;
import java.util.List;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.fastjson.JSONObject;
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
import com.xdadan.erp.common.core.domain.AjaxResult;
import com.xdadan.erp.common.core.page.TableDataInfo;
@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xdadan.erp.emis.domain.EmisTransPlanRule;
import com.xdadan.erp.emis.service.IEmisTransPlanRuleService;
import org.springframework.dao.DuplicateKeyException;
/**
* 供应商线路规划Controller
@ -77,8 +79,32 @@ public class EmisTransPlanRuleController extends EmisBaseController {
*/
@PreAuthorize("@ss.hasPermi('emis:emisTransPlanRule:draftSubmitRule')")
@PostMapping(value = "/draftSubmitRule")
public AjaxResult draftSubmitRule(@RequestBody EmisTransPlanRule emisTransPlanRule) throws EmisBizError {
return toAjax(emisTransPlanRuleService.draftSubmitRule(emisTransPlanRule));
public AjaxResult draftSubmitRule(@RequestBody EmisTransPlanRule emisTransPlanRule) {
JSONObject jObjOut = new JSONObject();
String result = "success";
String msg = "提交成功";
try {
emisTransPlanRuleService.draftSubmitRule(emisTransPlanRule);
jObjOut.put("ruleDetail", emisTransPlanRule);
} catch (EmisBizError ex) {
ex.printStackTrace();
result = "fail";
msg = ex.getErrorCode() + ":" + ex.getMessage();
} catch (DuplicateKeyException e) {
e.printStackTrace();
result = "fail";
msg = "数据重复";
} catch (Exception ex) {
result = "fail";
ex.printStackTrace();
msg = "系统异常:" + ex.getMessage();
if (ex instanceof EmisBizError) {
msg = ((EmisBizError) ex).getErrorCode() + ":" + ex.getMessage();
}
}
jObjOut.put("result", result);
jObjOut.put("msg", msg);
return AjaxResult.success("成功", jObjOut);
}
/**

View File

@ -74,13 +74,13 @@
</select>
<select id="selectEmisTransLineById" parameterType="Long" resultMap="EmisTransLineResult">
select id, line_code, line_name, line_name_en,trans_manager meter_rate, status, site_audit_man, site_audit_man_code, market_man, market_man_code, operate_man, operate_man_code, from_country, country, apply_scope, logo_type, trans_type, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, line_code, line_name, line_name_en,trans_manager, meter_rate, status, site_audit_man, site_audit_man_code, market_man, market_man_code, operate_man, operate_man_code, from_country, country, apply_scope, logo_type, trans_type, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_trans_line a
where a.id = #{id}
</select>
<select id="selectTransLineByName" parameterType="String" resultMap="EmisTransLineResult">
select id, line_code, line_name, line_name_en,trans_manager meter_rate, status, site_audit_man, site_audit_man_code, market_man, market_man_code, operate_man, operate_man_code, from_country, country, apply_scope, logo_type, trans_type, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, line_code, line_name, line_name_en,trans_manager, meter_rate, status, site_audit_man, site_audit_man_code, market_man, market_man_code, operate_man, operate_man_code, from_country, country, apply_scope, logo_type, trans_type, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_trans_line a
where a.del_flag = '0' and a.line_name = #{lineName}
</select>

View File

@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="nextSiteCode" column="next_site_code" />
<result property="nextSiteName" column="next_site_name" />
<result property="manager" column="manager" />
<result property="transManager" column="trans_manager" />
<result property="supplierCode" column="supplier_code" />
<result property="startDate" column="start_date" />
<result property="endDate" column="end_date" />
@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
s1.site_name as start_site_name, r.next_site_code, s2.site_name as next_site_name,
r.manager, r.supplier_code, r.start_date, r.end_date, r.remark,
r.del_flag, r.create_by, r.create_time, r.update_by, r.update_time, r.create_site, r.update_site,
l.line_name,
l.line_name,l.trans_manager,
(SELECT GROUP_CONCAT(s.name)
FROM emis_supplier s
WHERE FIND_IN_SET(s.code, r.supplier_code)