Commit f167c609 authored by tianyiming's avatar tianyiming

四横八纵值班管理接口修改

parent b8ba0d92
...@@ -149,9 +149,9 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc ...@@ -149,9 +149,9 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
* @return * @return
*/ */
Page<Map<String, Object>> getPersonInfoByPage(Page page, @Param("bizOrgCode") String bizOrgCode); Page<Map<String, Object>> getPersonInfoByPage(Page page, @Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> dutyCardCount( @Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> dutyCardCount();
List<Map<String, Object>> dutyCardList (@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> dutyCardList ();
} }
...@@ -35,9 +35,9 @@ public interface IDutyCommonService { ...@@ -35,9 +35,9 @@ public interface IDutyCommonService {
IPage<Map<String, Object>> pageListDetail(int current, int size, String beginDate, String endDate, String bizOrgCode) throws ParseException; IPage<Map<String, Object>> pageListDetail(int current, int size, String beginDate, String endDate, String bizOrgCode) throws ParseException;
List<Map<String, Object>> dutyCardCount(String bizOrgCode)throws ParseException; List<Map<String, Object>> dutyCardCount()throws ParseException;
List<Map<String, Object>> dutyCardList(String bizOrgCode)throws ParseException; List<Map<String, Object>> dutyCardList()throws ParseException;
/** /**
* 值班明细 * 值班明细
......
...@@ -627,7 +627,7 @@ WHERE ...@@ -627,7 +627,7 @@ WHERE
<select id="dutyCardCount" resultType="java.util.Map"> <select id="dutyCardCount" resultType="java.util.Map">
SELECT SELECT
'1601' as peopleType, 'fire' as peopleType,
count(*) as total count(*) as total
from from
(SELECT (SELECT
...@@ -645,14 +645,18 @@ WHERE ...@@ -645,14 +645,18 @@ WHERE
WHERE WHERE
c.sequence_nbr IS NOT NULL c.sequence_nbr IS NOT NULL
AND cs.sign_time LIKE concat( CURRENT_DATE ( ), '%' ) AND cs.sign_time LIKE concat( CURRENT_DATE ( ), '%' )
AND c.biz_org_code LIKE concat(#{bizOrgCode},'%')
GROUP BY GROUP BY
cs.USER_ID cs.USER_ID
ORDER BY ORDER BY
cs.sign_time DESC) d cs.sign_time DESC) d
union all union all
SELECT SELECT
b.peopleType, (CASE b.peopleType
WHEN 1602 THEN
'run'
ELSE
'overhaul'
END) peopleType,
count( * ) as total count( * ) as total
FROM FROM
( (
...@@ -682,10 +686,9 @@ WHERE ...@@ -682,10 +686,9 @@ WHERE
) a ) a
LEFT JOIN cb_org_usr ou ON ou.sequence_nbr = a.id LEFT JOIN cb_org_usr ou ON ou.sequence_nbr = a.id
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
where ou.biz_org_code like concat(#{bizOrgCode}, '%')
GROUP BY GROUP BY
a.id a.id
) b WHERE b.peopleType != '1601' ) b WHERE b.peopleType in ('1602','1604')
GROUP BY GROUP BY
peopleType peopleType
</select> </select>
...@@ -695,7 +698,7 @@ WHERE ...@@ -695,7 +698,7 @@ WHERE
c.sequence_nbr as id, c.sequence_nbr as id,
c.biz_org_name as userName, c.biz_org_name as userName,
IFNULL( cf.mobile_phone, '' ) telephone, IFNULL( cf.mobile_phone, '' ) telephone,
'驻站消防员' as peopleType '1601' as peopleType
FROM FROM
cb_org_usr c cb_org_usr c
RIGHT JOIN cb_sign cs ON c.sequence_nbr = cs.USER_ID RIGHT JOIN cb_sign cs ON c.sequence_nbr = cs.USER_ID
...@@ -706,7 +709,6 @@ WHERE ...@@ -706,7 +709,6 @@ WHERE
WHERE WHERE
c.sequence_nbr IS NOT NULL c.sequence_nbr IS NOT NULL
AND cs.sign_time LIKE concat( CURRENT_DATE ( ), '%' ) AND cs.sign_time LIKE concat( CURRENT_DATE ( ), '%' )
AND c.biz_org_code LIKE concat(#{bizOrgCode},'%')
GROUP BY GROUP BY
cs.USER_ID cs.USER_ID
ORDER BY ORDER BY
...@@ -716,7 +718,7 @@ WHERE ...@@ -716,7 +718,7 @@ WHERE
id, id,
userName, userName,
telephone, telephone,
(select name from cb_data_dictionary WHERE code = b.peopleType ) as peopleType peopleType
FROM FROM
( (
SELECT SELECT
...@@ -745,9 +747,8 @@ WHERE ...@@ -745,9 +747,8 @@ WHERE
) a ) a
LEFT JOIN cb_org_usr ou ON ou.sequence_nbr = a.id LEFT JOIN cb_org_usr ou ON ou.sequence_nbr = a.id
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
where ou.biz_org_code like concat(#{bizOrgCode}, '%')
GROUP BY GROUP BY
a.id a.id
) b WHERE b.peopleType != '1601') ) b WHERE b.peopleType in ('1602','1604'))
</select> </select>
</mapper> </mapper>
...@@ -88,13 +88,8 @@ public class DutyPersonController extends BaseController { ...@@ -88,13 +88,8 @@ public class DutyPersonController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "值班管理卡片人员统计", notes = "值班管理卡片人员统计") @ApiOperation(httpMethod = "GET", value = "值班管理卡片人员统计", notes = "值班管理卡片人员统计")
public ResponseModel<Map<String, Object>> cardDetail() throws ParseException { public ResponseModel<Map<String, Object>> cardDetail() throws ParseException {
ReginParams selectedOrgInfo = getSelectedOrgInfo();
String bizOrgCode = ObjectUtils.isEmpty(selectedOrgInfo) || ObjectUtils.isEmpty(selectedOrgInfo.getPersonIdentity()) ? "" : selectedOrgInfo.getPersonIdentity().getBizOrgCode();
if (StringUtils.isEmpty(bizOrgCode)) {
return ResponseHelper.buildResponse(null);
}
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
List<Map<String, Object>> maps = iDutyPersonService.dutyCardCount(bizOrgCode); List<Map<String, Object>> maps = iDutyPersonService.dutyCardCount();
maps.forEach(e->map.put(e.get("peopleType").toString(),e.get("total"))); maps.forEach(e->map.put(e.get("peopleType").toString(),e.get("total")));
return ResponseHelper.buildResponse(map); return ResponseHelper.buildResponse(map);
} }
...@@ -104,12 +99,8 @@ public class DutyPersonController extends BaseController { ...@@ -104,12 +99,8 @@ public class DutyPersonController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "值班管理卡片人员统计", notes = "值班管理卡片人员统计") @ApiOperation(httpMethod = "GET", value = "值班管理卡片人员统计", notes = "值班管理卡片人员统计")
public ResponseModel<List<Map<String, Object>>> cardList() throws ParseException { public ResponseModel<List<Map<String, Object>>> cardList() throws ParseException {
ReginParams selectedOrgInfo = getSelectedOrgInfo();
String bizOrgCode = ObjectUtils.isEmpty(selectedOrgInfo) || ObjectUtils.isEmpty(selectedOrgInfo.getPersonIdentity()) ? "" : selectedOrgInfo.getPersonIdentity().getBizOrgCode(); return ResponseHelper.buildResponse(iDutyPersonService.dutyCardList());
if (StringUtils.isEmpty(bizOrgCode)) {
return ResponseHelper.buildResponse(null);
}
return ResponseHelper.buildResponse(iDutyPersonService.dutyCardList(bizOrgCode));
} }
......
...@@ -150,14 +150,14 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -150,14 +150,14 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
} }
public List<Map<String, Object>> dutyCardCount(String bizOrgCode) public List<Map<String, Object>> dutyCardCount()
throws ParseException { throws ParseException {
return dynamicFormInstanceMapper.dutyCardCount( bizOrgCode); return dynamicFormInstanceMapper.dutyCardCount();
} }
public List<Map<String, Object>> dutyCardList( String bizOrgCode) public List<Map<String, Object>> dutyCardList()
throws ParseException { throws ParseException {
return dynamicFormInstanceMapper.dutyCardList(bizOrgCode); return dynamicFormInstanceMapper.dutyCardList();
} }
private void fillDutyShiftData(String beginDate, String endDate, Map<String, Object> m) throws ParseException { private void fillDutyShiftData(String beginDate, String endDate, Map<String, Object> m) throws ParseException {
......
...@@ -3691,5 +3691,18 @@ ...@@ -3691,5 +3691,18 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="tym" id="202301050916">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</not>
</preConditions>
<comment>cb_data_dictionary 添加人员类型</comment>
<sql>
REPLACE INTO cb_data_dictionary (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `extend`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1604, '1604', '检修人员', 'DLRYLX', NULL, NULL, NULL, NULL, NULL, NULL, b'0', 4);
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment