opt:提交验箱接口代码,所有回传mes接口增加请求超时时间120s,提交用户页面 部门和角色未回显,提交任务查询优化

This commit is contained in:
DESKTOP-5DIJMF9\admin
2025-02-28 10:21:01 +08:00
parent e54878bbe8
commit 60d26adbc6
7 changed files with 204 additions and 100 deletions

View File

@@ -25,36 +25,33 @@
sys_user.extuser_id as extuserId sys_user.extuser_id as extuserId
</sql> </sql>
<insert id="insertDataPermission"> <insert id="insertDataPermission">
INSERT INTO sys_user_data_permission(user_id, permission_scope_type, permission_id) INSERT INTO sys_user_data_permission(user_id, permission_scope_type, permission_id) VALUES (#{dataPermission.user_id}, #{dataPermission.permission_scope_type}, #{dataPermission.permission_id})
VALUES (#{dataPermission.user_id}, #{dataPermission.permission_scope_type}, #{dataPermission.permission_id})
</insert> </insert>
<delete id="deleteDataPermissionById"> <delete id="deleteDataPermissionById">
DELETE DELETE FROM sys_user_data_permission WHERE user_id = #{userId}
FROM sys_user_data_permission
WHERE user_id = #{userId}
</delete> </delete>
<resultMap id="UserDetail" type="org.nl.system.service.user.dto.SysUserDetail"> <resultMap id="UserDetail" type="org.nl.system.service.user.dto.SysUserDetail" >
<id column="userId" property="user_id"/> <id column="userId" property="user_id" />
<result column="username" property="username"/> <result column="username" property="username" />
<result column="personName" property="person_name"/> <result column="personName" property="person_name" />
<result column="gender" property="gender"/> <result column="gender" property="gender" />
<result column="phone" property="phone"/> <result column="phone" property="phone" />
<result column="email" property="email"/> <result column="email" property="email" />
<result column="avatarName" property="avatar_name"/> <result column="avatarName" property="avatar_name" />
<result column="avatarPath" property="avatar_path"/> <result column="avatarPath" property="avatar_path" />
<result column="password" property="password"/> <result column="password" property="password" />
<result column="isAdmin" property="is_admin"/> <result column="isAdmin" property="is_admin" />
<result column="isUsed" property="is_used"/> <result column="isUsed" property="is_used" />
<result column="pwdResetUserId" property="pwd_reset_user_id"/> <result column="pwdResetUserId" property="pwd_reset_user_id" />
<result column="pwdResetTime" property="pwd_reset_time"/> <result column="pwdResetTime" property="pwd_reset_time" />
<result column="create_id" property="create_id"/> <result column="create_id" property="create_id" />
<result column="createName" property="create_name"/> <result column="createName" property="create_name" />
<result column="createTime" property="create_time"/> <result column="createTime" property="create_time" />
<result column="updateId" property="update_id"/> <result column="updateId" property="update_id" />
<result column="updateName" property="update_name"/> <result column="updateName" property="update_name" />
<result column="updateTime" property="update_time"/> <result column="updateTime" property="update_time" />
<result column="extpersonId" property="extperson_id"/> <result column="extpersonId" property="extperson_id" />
<result column="extuserId" property="extuser_id"/> <result column="extuserId" property="extuser_id" />
<collection property="depts" ofType="org.nl.system.service.dept.dao.SysDept"> <collection property="depts" ofType="org.nl.system.service.dept.dao.SysDept">
<id property="dept_id" column="dept_id"/> <id property="dept_id" column="dept_id"/>
<result column="dept_name" property="name"/> <result column="dept_name" property="name"/>
@@ -83,13 +80,13 @@
and sys_user.is_used = #{query.is_used} and sys_user.is_used = #{query.is_used}
</if> </if>
<if test="query.start_time != null"> <if test="query.start_time != null">
and sys_user.create_time >= #{query.startTime} and and sys_user.create_time >= #{query.startTime}
</if> </if>
<if test="query.end_time != null"> <if test="query.end_time != null">
and #{query.end_time} >= sys_user.create_time and #{query.end_time} >= sys_user.create_time
</if> </if>
<if test="query.blurry != null"> <if test="query.blurry != null">
and (email like #{query.blurry} or username like concat('%',#{query.blurry},'%') or person_name like concat('%',#{query.blurry},'%')) and (email like #{query.blurry} or username like #{query.blurry} or person_name like #{query.blurry})
</if> </if>
</where> </where>
</select> </select>
@@ -126,15 +123,11 @@
</select> </select>
<select id="getUserDataPermissionByPermissionId" <select id="getUserDataPermissionByPermissionId"
resultType="org.nl.system.service.user.dto.UserDataPermissionDto"> resultType="org.nl.system.service.user.dto.UserDataPermissionDto">
SELECT * SELECT * FROM sys_user_data_permission WHERE permission_id = #{permissionId}
FROM sys_user_data_permission
WHERE permission_id = #{permissionId}
</select> </select>
<select id="getUserDataPermissionByUserId" <select id="getUserDataPermissionByUserId"
resultType="org.nl.system.service.user.dto.UserDataPermissionDto"> resultType="org.nl.system.service.user.dto.UserDataPermissionDto">
SELECT * SELECT * FROM sys_user_data_permission WHERE user_id = #{userId}
FROM sys_user_data_permission
WHERE user_id = #{userId}
</select> </select>
<select id="getUserIdByDeptId" resultType="java.lang.String"> <select id="getUserIdByDeptId" resultType="java.lang.String">
SELECT SELECT

View File

@@ -140,6 +140,13 @@ public class LmsToMesController {
return new ResponseEntity<>(lmsToMesService.momBoxPackageSubmit(jo), HttpStatus.OK); return new ResponseEntity<>(lmsToMesService.momBoxPackageSubmit(jo), HttpStatus.OK);
} }
@PostMapping("/momBoxCheckSubmit")
@Log("LMS将验箱信息传递给MES")
@SaIgnore
public ResponseEntity<Object> momBoxCheckSubmit(@RequestBody JSONObject jo) {
return new ResponseEntity<>(lmsToMesService.BoxDataCollectionSubmit2(jo), HttpStatus.OK);
}
@PostMapping("/GetInspectionResult") @PostMapping("/GetInspectionResult")
@Log("LMS获取MES称重后子卷信息") @Log("LMS获取MES称重后子卷信息")
@SaIgnore @SaIgnore

View File

@@ -183,5 +183,7 @@ public interface LmsToMesService {
JSONObject momBoxPackageSubmit(JSONObject jo); JSONObject momBoxPackageSubmit(JSONObject jo);
JSONObject BoxDataCollectionSubmit2(JSONObject jo);
JSONObject getInspectionResult(JSONObject jo); JSONObject getInspectionResult(JSONObject jo);
} }

View File

@@ -38,6 +38,8 @@ public class LmsToMesServiceImpl implements LmsToMesService {
private static String is_connect_mes = "1"; private static String is_connect_mes = "1";
private static Integer time_out = 120000;
@Autowired @Autowired
private IBstIvtBoxinfoService bstIvtBoxinfoService; private IBstIvtBoxinfoService bstIvtBoxinfoService;
@@ -72,6 +74,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param)) .body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("momRollFoilWeighing接口输出参数为-------------------" + result.toString()); log.info("momRollFoilWeighing接口输出参数为-------------------" + result.toString());
@@ -131,6 +134,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param)) .body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("momRollBakeInBound接口输出参数为-------------------" + result.toString()); log.info("momRollBakeInBound接口输出参数为-------------------" + result.toString());
@@ -194,6 +198,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param)) .body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("momRollBakeOutBound接口输出参数为-------------------" + result.toString()); log.info("momRollBakeOutBound接口输出参数为-------------------" + result.toString());
@@ -234,6 +239,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param)) .body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("momRollSemiFGInboundComplete接口输出参数为-------------------" + result.toString()); log.info("momRollSemiFGInboundComplete接口输出参数为-------------------" + result.toString());
@@ -288,6 +294,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(jo)) .body(String.valueOf(jo))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("airSwellWithPaperTubeAssComplete接口输出参数为-------------------" + result.toString()); log.info("airSwellWithPaperTubeAssComplete接口输出参数为-------------------" + result.toString());
@@ -346,6 +353,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(jo)) .body(String.valueOf(jo))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("airSwellWithPaperTubeAssComplete接口输出参数为-------------------" + result.toString()); log.info("airSwellWithPaperTubeAssComplete接口输出参数为-------------------" + result.toString());
@@ -396,6 +404,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(jo)) .body(String.valueOf(jo))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("airSwellWithPaperTubeAssArrival接口输出参数为-------------------" + result.toString()); log.info("airSwellWithPaperTubeAssArrival接口输出参数为-------------------" + result.toString());
@@ -449,8 +458,10 @@ public class LmsToMesServiceImpl implements LmsToMesService {
String api = "CamstarApi/ChildRollFGInboundComplete"; String api = "CamstarApi/ChildRollFGInboundComplete";
url = url + api; url = url + api;
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest
.post(url)
.body(String.valueOf(jo)) .body(String.valueOf(jo))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("childRollFGInboundComplete接口输出参数为-------------------" + result.toString()); log.info("childRollFGInboundComplete接口输出参数为-------------------" + result.toString());
@@ -493,6 +504,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param)) .body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("childRollFGOutboundComplete接口输出参数为-------------------" + result.toString()); log.info("childRollFGOutboundComplete接口输出参数为-------------------" + result.toString());
@@ -540,6 +552,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param)) .body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("LMSUnPackage接口输出参数为-------------------" + result.toString()); log.info("LMSUnPackage接口输出参数为-------------------" + result.toString());
@@ -587,6 +600,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param)) .body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("LMSPackakge接口输出参数为-------------------" + result.toString()); log.info("LMSPackakge接口输出参数为-------------------" + result.toString());
@@ -623,6 +637,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param)) .body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("scrapAudit接口输出参数为-------------------" + result.toString()); log.info("scrapAudit接口输出参数为-------------------" + result.toString());
@@ -659,6 +674,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param)) .body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("proudDayData接口输出参数为-------------------" + result.toString()); log.info("proudDayData接口输出参数为-------------------" + result.toString());
@@ -700,6 +716,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param)) .body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("ChildScrapUpdate接口输出参数为-------------------" + result.toString()); log.info("ChildScrapUpdate接口输出参数为-------------------" + result.toString());
@@ -736,6 +753,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("sendSalesIvtMsg接口输出参数为-------------------" + result.toString()); log.info("sendSalesIvtMsg接口输出参数为-------------------" + result.toString());
@@ -771,6 +789,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param)) .body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("sendSalesIvtMsgParam接口输出参数为-------------------" + result.toString()); log.info("sendSalesIvtMsgParam接口输出参数为-------------------" + result.toString());
@@ -825,6 +844,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
/*String resultMsg = HttpRequest.post(url) /*String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param)) .body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("momAutoTransterMoveIn接口输出参数为-------------------" + result.toString()); log.info("momAutoTransterMoveIn接口输出参数为-------------------" + result.toString());
@@ -868,6 +888,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param)) .body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
log.info("momGetPackingInfo接口输出参数为-------------------" + result.toString()); log.info("momGetPackingInfo接口输出参数为-------------------" + result.toString());
@@ -931,6 +952,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param)) .body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
IpdmBiSubpackagerelationService subpackagerelationService = SpringContextHolder.getBean(IpdmBiSubpackagerelationService.class); IpdmBiSubpackagerelationService subpackagerelationService = SpringContextHolder.getBean(IpdmBiSubpackagerelationService.class);
@@ -958,6 +980,69 @@ public class LmsToMesServiceImpl implements LmsToMesService {
return result; return result;
} }
@Override
public JSONObject BoxDataCollectionSubmit2(JSONObject param) {
log.info("BoxDataCollectionSubmit2接口输入参数为-------------------" + param.toString());
String box_no = param.getString("box_no");
String box_weight = param.getString("box_weight");
if (StrUtil.isEmpty(box_no)) {
throw new BadRequestException("木箱号不能为空!");
}
if (StrUtil.isEmpty(box_weight)) {
throw new BadRequestException("木箱毛重不能为空!");
}
JSONObject result = new JSONObject();
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL2").getValue();
String api = "CamstarApi/BoxDataCollectionSubmit2";
url = url + api;
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
String Password = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
param.put("UserName", UserName);
param.put("Password", Password);
param.put("BoxContainerName", box_no);
param.put("BoxWeight", box_weight);
JSONArray rows = new JSONArray();
JSONObject row1 = new JSONObject();
row1.put("DataPointName","保护棉是否填充");
row1.put("DataType","7");
row1.put("DataValue","true");
row1.put("DataCollectionDefId","001c61800000004f");
row1.put("DataCollectionDefName","PACKAGE");
row1.put("DataCollectionDefName","PACKAGE");
rows.add(row1);
row1.put("DataPointName","信息核对准确");
rows.add(row1);
row1.put("DataPointName","木箱是否防护");
rows.add(row1);
param.put("DataPoints", rows);
try {
String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body();
result = JSONObject.parseObject(resultMsg);
log.info("BoxDataCollectionSubmit2接口输出参数为-------------------" + result.toString());
String RTYPE = result.getString("RTYPE");
if ("E".equals(RTYPE)) {
throw new BadRequestException(result.getString("RTMSG"));
}
} catch (Exception e) {
throw new BadRequestException("MES提示错误" + e.getMessage());
}
return result;
}
public JSONObject getInspectionResult(JSONObject param) { public JSONObject getInspectionResult(JSONObject param) {
log.info("getInspectionResult接口输出参数为-------------------" + param.toString()); log.info("getInspectionResult接口输出参数为-------------------" + param.toString());
@@ -988,6 +1073,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
try { try {
String resultMsg = HttpRequest.post(url) String resultMsg = HttpRequest.post(url)
.body(String.valueOf(param)) .body(String.valueOf(param))
.timeout(time_out)//超时时间,毫秒
.execute().body(); .execute().body();
result = JSONObject.parseObject(resultMsg); result = JSONObject.parseObject(resultMsg);
IpdmBiSubpackagerelationService subpackagerelationService = SpringContextHolder.getBean(IpdmBiSubpackagerelationService.class); IpdmBiSubpackagerelationService subpackagerelationService = SpringContextHolder.getBean(IpdmBiSubpackagerelationService.class);

View File

@@ -88,10 +88,10 @@ public class TaskServiceImpl implements TaskService {
map.put("finishTypeList", whereJson.getString("finishTypeList")); map.put("finishTypeList", whereJson.getString("finishTypeList"));
} }
if (StrUtil.isNotEmpty(whereJson.getString("begin_time"))) { if (StrUtil.isNotEmpty(whereJson.getString("begin_time"))) {
map.put("begin_time", whereJson.getString("begin_time")); map.put("begin_time", whereJson.getString("begin_time").substring(0, 10)+" 00:00:00");
} }
if (StrUtil.isNotEmpty(whereJson.getString("end_time"))) { if (StrUtil.isNotEmpty(whereJson.getString("end_time"))) {
map.put("end_time", whereJson.getString("end_time")); map.put("end_time", whereJson.getString("end_time").substring(0, 10)+" 99:99:99");
} }
if (StrUtil.isNotEmpty(whereJson.getString("is_delete"))) { if (StrUtil.isNotEmpty(whereJson.getString("is_delete"))) {
map.put("is_delete", whereJson.getString("is_delete")); map.put("is_delete", whereJson.getString("is_delete"));

View File

@@ -52,60 +52,59 @@
IF 输入.flag = "1" IF 输入.flag = "1"
PAGEQUERY PAGEQUERY
SELECT * FROM ( SELECT * FROM (
SELECT SELECT
task.*, task.*,
md.class_name task_type_name, md.class_name task_type_name,
user.person_name AS create_name1, user.person_name AS create_name1,
dict.label task_status_name, dict.label task_status_name,
case when task.task_type like '0105%' then 'LK' when task.task_type like '0107%' then 'LK' ELSE task.product_area end AS final_product_area case when task.task_type like '0105%' then 'LK' when task.task_type like '0107%' then 'LK' ELSE task.product_area end AS final_product_area
FROM FROM
sch_base_task task (select
LEFT JOIN md_pb_classstandard md ON task.task_type = md.class_code tas.*
LEFT JOIN sys_user user ON user.username = task.create_name from
LEFT JOIN sys_dict dict ON dict.`value` = task.task_status AND dict.`code` = 'task_status' sch_base_task tas
WHERE where 1=1
1=1 OPTION 输入.is_delete <> ""
OPTION 输入.is_delete <> "" tas.is_delete = 输入.is_delete
task.is_delete = 输入.is_delete ENDOPTION
OPTION 输入.finished_type <> ""
tas.finished_type = 输入.finished_type
ENDOPTION
OPTION 输入.unFinish <> ""
tas.task_status <> '07'
ENDOPTION
OPTION 输入.task_status <> ""
find_in_set( tas.task_status, 输入.task_status)
ENDOPTION
OPTION 输入.vehicle_code <> ""
(tas.vehicle_code like 输入.vehicle_code OR tas.material_code like 输入.vehicle_code OR tas.vehicle_code2 like 输入.vehicle_code)
ENDOPTION
OPTION 输入.task_code <> ""
(tas.task_code like 输入.task_code)
ENDOPTION
OPTION 输入.point_code1 <> ""
(tas.point_code1 like 输入.point_code1)
ENDOPTION
OPTION 输入.begin_time <> ""
tas.create_time >= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
tas.create_time <= 输入.end_time
ENDOPTION
) task
LEFT JOIN md_pb_classstandard md ON task.task_type = md.class_code
LEFT JOIN sys_user user ON user.username = task.create_name
LEFT JOIN sys_dict dict ON dict.`value` = task.task_status AND dict.`code` = 'task_status'
WHERE
1=1
OPTION 输入.task_type <> ""
md.class_id in 输入.task_type
ENDOPTION
) a
WHERE 1=1
OPTION 输入.in_area_id <> ""
a.final_product_area IN 输入.in_area_id
ENDOPTION ENDOPTION
OPTION 输入.task_type <> "" ENDSELECT
md.class_id in 输入.task_type ENDPAGEQUERY
ENDOPTION ENDIF
OPTION 输入.finished_type <> ""
task.finished_type = 输入.finished_type
ENDOPTION
OPTION 输入.begin_time <> ""
task.create_time >= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
task.create_time <= 输入.end_time
ENDOPTION
OPTION 输入.unFinish <> ""
task.task_status <> '07'
ENDOPTION
OPTION 输入.task_status <> ""
find_in_set( task.task_status, 输入.task_status)
ENDOPTION
OPTION 输入.vehicle_code <> ""
(task.vehicle_code like 输入.vehicle_code OR task.material_code like 输入.vehicle_code OR task.vehicle_code2 like 输入.vehicle_code)
ENDOPTION
OPTION 输入.task_code <> ""
(task.task_code like 输入.task_code)
ENDOPTION
OPTION 输入.point_code1 <> ""
(task.point_code1 like 输入.point_code1)
ENDOPTION
OPTION 输入.begin_time <> ""
task.create_time >= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
task.create_time <= 输入.end_time
ENDOPTION
) a
WHERE 1=1
OPTION 输入.in_area_id <> ""
a.final_product_area IN 输入.in_area_id
ENDOPTION
ENDSELECT
ENDPAGEQUERY
ENDIF

View File

@@ -88,7 +88,8 @@
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" :default-time="['00:00:00', '23:59:59']"
@change="crud.toQuery" @input="onInput()"
@change="mytoQuery"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -209,7 +210,6 @@ import crudTask from '@/views/wms/sch/task/task'
import CRUD, { crud, header, presenter } from '@crud/crud' import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation' import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect' import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@@ -219,7 +219,7 @@ export default {
name: 'Task', name: 'Task',
dicts: ['acs_task_type', 'vehicle_type'], dicts: ['acs_task_type', 'vehicle_type'],
components: { components: {
pagination, crudOperation, rrOperation, Treeselect, udOperation pagination, crudOperation, rrOperation, Treeselect
}, },
mixins: [presenter(), header(), crud()], mixins: [presenter(), header(), crud()],
cruds() { cruds() {
@@ -255,6 +255,7 @@ export default {
permission: { permission: {
}, },
query_flag: true,
rules: {}, rules: {},
classes1: [] classes1: []
} }
@@ -267,13 +268,16 @@ export default {
crudTask.getFinishType().then(data => { crudTask.getFinishType().then(data => {
this.finishTypeList = data this.finishTypeList = data
}) })
// this.crud.query.task_status = ['-1'] this.crud.query.createTime = [new Date().daysAgo(7), new Date()]
// this.crud.toQuery()
}, },
methods: { methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据 // 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() { [CRUD.HOOK.beforeRefresh]() {
return true if (this.query_flag) {
this.crud.query.begin_time = (new Date().daysAgo(7)).strftime('%F', 'zh')
this.crud.query.end_time = (new Date()).strftime('%F', 'zh')
this.query_flag = false
}
}, },
initClass1() { initClass1() {
const param = { const param = {
@@ -285,6 +289,19 @@ export default {
this.classes1 = data this.classes1 = data
}) })
}, },
onInput() {
this.$forceUpdate()
},
mytoQuery(array1) {
if (array1 === null) {
this.crud.query.begin_time = ''
this.crud.query.end_time = ''
} else {
this.crud.query.begin_time = array1[0]
this.crud.query.end_time = array1[1]
}
this.crud.toQuery()
},
buildTree(classes) { buildTree(classes) {
classes.forEach(data => { classes.forEach(data => {
if (data.children) { if (data.children) {