lyfO_o
2021-09-16 0dfab938c5116c8fa0191cadf36a47f5bb4f2936
申购:管制品 搜索
已修改7个文件
106 ■■■■ 文件已修改
src/main/java/com/nanometer/smartlab/controller/ApplyMngController.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/nanometer/smartlab/controller/RequireMngController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/nanometer/smartlab/service/OpeApplyService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/nanometer/smartlab/service/OpeApplyServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/apply_mng.xhtml 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/nanometer/smartlab/controller/ApplyMngController.java
@@ -74,6 +74,8 @@
    private Integer status;
    private Integer favor;
    private List<ApplyStatus> statusSelectList;
    private String controlProduct;
    private LazyDataModel<SysReagent> reagentDataModel;
    private LazyDataModel<SysReagent> reagentFavorDataModel;
@@ -240,7 +242,7 @@
            if(selectedList!=null&&selectedList.size()>0){
                realDataList=selectedList;
            }else {
                realDataList=opeApplyService.getOpeApplyList(reagentName, startDeadline, endDeadline, status, getUserId(), null, queryCAS, null, null,null,applyUserName,(byte)1);
                realDataList=opeApplyService.getOpeApplyList(reagentName, startDeadline,controlProduct, endDeadline, status, getUserId(), null, queryCAS, null, null,null,applyUserName,(byte)1);
            }
             List<String> headerList = new ArrayList<>();
@@ -502,10 +504,10 @@
                public List<OpeApply> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, Object> filters) {
                    List<OpeApply> list = null;
                    try {
                        int count = opeApplyService.getOpeApplyTotalCount(reagentName, startDeadline, endDeadline, status, getUserId(), null, queryCAS,null,applyUserName,(byte)1);
                        int count = opeApplyService.getOpeApplyTotalCount(reagentName, startDeadline,controlProduct, endDeadline, status, getUserId(), null, queryCAS,null,applyUserName,(byte)1);
                        this.setRowCount(count);
                        if (count > 0) {
                            list = opeApplyService.getOpeApplyList(reagentName, startDeadline, endDeadline, status, getUserId(), null, queryCAS, first, pageSize,null,applyUserName,(byte)1);
                            list = opeApplyService.getOpeApplyList(reagentName, startDeadline,controlProduct, endDeadline, status, getUserId(), null, queryCAS, first, pageSize,null,applyUserName,(byte)1);
                            for(int i=0;i<list.size();i++){
                                if(list.get(i).getBeforeApproveUserId()!=null&&!list.get(i).getBeforeApproveUserId().equals("")){
                                    String name=list.get(i).getApproveUserName();
@@ -631,11 +633,11 @@
                        String applyUserId = getUserId();
                        int count = 0;
                        if (StringUtils.isNotBlank(applyUserId)) {
                            count = opeApplyService.getOpeApplyTotalCount(null, null, null, null, applyUserId, null, null,applyCode,null,(byte)1);
                            count = opeApplyService.getOpeApplyTotalCount(null, null, null,null, null, applyUserId, null, null,applyCode,null,(byte)1);
                        }
                        this.setRowCount(count);
                        if (count > 0) {
                            list = opeApplyService.getOpeApplyList(null, null, null, null, applyUserId, null, null, first, pageSize,applyCode,null,(byte)1);
                            list = opeApplyService.getOpeApplyList(null, null,null, null, null, applyUserId, null, null, first, pageSize,applyCode,null,(byte)1);
                        }
                        selectedList = null;
                    } catch (Exception e) {
@@ -1004,4 +1006,12 @@
    public void setTabValue(int tabValue) {
        this.tabValue = tabValue;
    }
    public String getControlProduct() {
        return controlProduct;
    }
    public void setControlProduct(String controlProduct) {
        this.controlProduct = controlProduct;
    }
}
src/main/java/com/nanometer/smartlab/controller/RequireMngController.java
@@ -143,10 +143,10 @@
                public List<OpeApply> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, Object> filters) {
                    List<OpeApply> list = null;
                    try {
                        int count = opeApplyService.getOpeApplyTotalCount(reagentName, startDeadline, endDeadline, ApplyStatus.APPROVED.getKey(), null, null, null,null,null,(byte)1);
                        int count = opeApplyService.getOpeApplyTotalCount(reagentName, startDeadline,null, endDeadline, ApplyStatus.APPROVED.getKey(), null, null, null,null,null,(byte)1);
                        this.setRowCount(count);
                        if (count > 0) {
                            list = opeApplyService.getOpeApplyList(reagentName, startDeadline, endDeadline, ApplyStatus.APPROVED.getKey(), null, null, null, first, pageSize,null,null,(byte)1);
                            list = opeApplyService.getOpeApplyList(reagentName, startDeadline,null, endDeadline, ApplyStatus.APPROVED.getKey(), null, null, null, first, pageSize,null,null,(byte)1);
                        }
                    } catch (Exception e) {
                        logger.error(e);
src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.java
@@ -60,4 +60,7 @@
    void insertList(List<OpeApply> opeApplyList);
    OpeApplyReserve getOpeApplyReserveListByNameForRowData(@Param("id") String rowKey);
    List<Map> getApplyControlInfo();
}
src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml
@@ -179,9 +179,13 @@
    left join sys_user as sys on sys.id=oa.before_approve_user_id
    left join sys_user as fir on fir.id=oa.first_user
    left join base_meta as bm on sr.product_home = bm.id
    left join base_meta as bm1 on bm1.id = sr.control_products
    where oa.valid_flag = 1
    <if test="isShow != null and isShow ==0">
        and (ss.valid_flag = 1 or sr.type = 0)
    </if>
      <if test="controlProduct != null and controlProduct != ''">
          and bm1.meta_value like concat("%",#{controlProduct},"%")
    </if>
    <include refid="queryWhereSql"/>
    order by oa.create_time desc
@@ -200,9 +204,13 @@
      left join sys_user as sys on sys.id=oa.before_approve_user_id
      left join sys_user as fir on fir.id=oa.first_user
      left join base_meta as bm on sr.product_home = bm.id
      left join base_meta as bm1 on bm1.id = sr.control_products
      where oa.valid_flag = 1
      <if test="isShow != null and isShow ==0">
          and (ss.valid_flag = 1 or sr.type = 0)
      </if>
      <if test="controlProduct != null and controlProduct != ''">
          and bm1.meta_value like concat("%",#{controlProduct},"%")
      </if>
    <include refid="queryWhereSql"/>
  </select>
@@ -571,6 +579,38 @@
    </select>
    <select id="getApplyControlInfo" resultType="java.util.Map">
               (SELECT sum(oa.num) sum,"易制毒" name from ope_apply oa
        LEFT JOIN sys_reagent sr on oa.reagent_id = sr.id
        LEFT JOIN base_meta bm on bm.id = sr.control_products
        where
        oa.valid_flag = 1
        and sr.valid_flag = 1
        and YEAR(oa.create_time)=YEAR(NOW())
        and oa.status in(2,3,4,6)
        and
        meta_value like "%易制毒%") UNION ALL(
            SELECT sum(oa.num) sum,"易制爆"  name from ope_apply oa
        LEFT JOIN sys_reagent sr on oa.reagent_id = sr.id
        LEFT JOIN base_meta bm on bm.id = sr.control_products
        where
        oa.valid_flag = 1
        and sr.valid_flag = 1
        and YEAR(oa.create_time)=YEAR(NOW())
        and oa.status in(2,3,4,6)
        and meta_value like "%易制爆%")UNION ALL(
        SELECT sum(oa.num) sum,"总数"  name from ope_apply oa
        LEFT JOIN sys_reagent sr on oa.reagent_id = sr.id
        where
        oa.valid_flag = 1
        and sr.valid_flag = 1
        and YEAR(oa.create_time)=YEAR(NOW())
        and oa.status in(2,3,4,6)
        )
    </select>
    <update id="updateByReId" parameterType="java.util.Map">
src/main/java/com/nanometer/smartlab/service/OpeApplyService.java
@@ -9,19 +9,20 @@
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
import java.util.Map;
/**
 * Created by johnny on 17/12/12.
 */
public interface OpeApplyService {
    public List<OpeApply> getOpeApplyList(String reagentName, Timestamp startDeadline, Timestamp endDeadline, Integer status,
    public List<OpeApply> getOpeApplyList(String reagentName, Timestamp startDeadline,String controlProduct, Timestamp endDeadline, Integer status,
                                          String applyUserId, String approveUserId, String queryCas,
                                          Integer first, Integer pageSize,String applyCode,String applyUserName,Byte isShow);
    public List<OpeApply> getOpeApplyListForApproval(String applyUserName,String approvaUserName,String reagentName, Timestamp startDeadline, Timestamp endDeadline, Integer status,
                                          String applyUserId, String approveUserId, String queryCas,
                                          Integer first, Integer pageSize,String applyCode,String searchApproval);
    public int getOpeApplyTotalCount(String reagentName, Timestamp startDeadline, Timestamp endDeadline, Integer status,
    public int getOpeApplyTotalCount(String reagentName, Timestamp startDeadline,String controlProduct, Timestamp endDeadline, Integer status,
                                     String applyUserId, String approveUserId, String queryCas,String applyCode,String applyUserName,Byte isShow);
    public int getOpeApplyTotalCountForApproval(String applyUserName,String approvaUserName,String reagentName, Timestamp startDeadline, Timestamp endDeadline, Integer status,
                                     String applyUserId, String approveUserId, String queryCas,String applyCode,String searchApproval);
src/main/java/com/nanometer/smartlab/service/OpeApplyServiceImpl.java
@@ -69,7 +69,7 @@
    private SysUserService sysUserService;
    @Transactional(propagation = Propagation.REQUIRED)
    public List<OpeApply> getOpeApplyList(String reagentName, Timestamp startDeadline, Timestamp endDeadline, Integer status,
    public List<OpeApply> getOpeApplyList(String reagentName, Timestamp startDeadline, String controlProduct,Timestamp endDeadline, Integer status,
                                          String applyUserId, String approveUserId, String queryCas,
                                          Integer first, Integer pageSize,String applyCode,String applyUserName,Byte isShow) {
        try {
@@ -81,6 +81,7 @@
            params.put("endDeadline", endDeadline);
            params.put("status", status);
            params.put("isShow", isShow);
            params.put("controlProduct", controlProduct);
            if (StringUtils.isNotBlank(applyUserId)) {
                SysUser sysUser = sysUserService.getSysUser(applyUserId);
@@ -192,7 +193,7 @@
    }
    @Transactional(propagation = Propagation.REQUIRED)
    public int getOpeApplyTotalCount(String reagentName, Timestamp startDeadline, Timestamp endDeadline, Integer status,
    public int getOpeApplyTotalCount(String reagentName, Timestamp startDeadline,String controlProduct, Timestamp endDeadline, Integer status,
                                     String applyUserId, String approveUserId, String queryCas,String applyCode,String applyUserName,Byte isShow) {
        try {
            Map<String, Object> params = new HashMap<String, Object>();
@@ -203,6 +204,7 @@
            params.put("endDeadline", endDeadline);
            params.put("status", status);
            params.put("isShow", isShow);
            params.put("controlProduct", controlProduct);
            if (StringUtils.isNotBlank(applyUserId)) {
                SysUser sysUser = sysUserService.getSysUser(applyUserId);
src/main/webapp/apply_mng.xhtml
@@ -15,8 +15,7 @@
        <p:panel styleClass="center-header">
            <p:outputLabel styleClass="title" value="申购管理"></p:outputLabel>
            <p:panelGrid styleClass="filter" columns="13">
                <p:row>
            <p:panelGrid styleClass="filter" columns="16">
                    <p:outputLabel value="申购产品:"></p:outputLabel>
                    <p:inputText value="#{applyMngController.reagentName}"></p:inputText>
@@ -31,8 +30,6 @@
                    <p:calendar value="#{applyMngController.endDeadline}" converter="timestampConvert"
                                pattern="yyyy-MM-dd" locale="zh_CN"></p:calendar>
                    <p:outputLabel value="状态:"></p:outputLabel>
                </p:row>
                <p:row>
                    <p:selectOneMenu value="#{applyMngController.status}">
                        <f:selectItem itemLabel="全部" itemValue="#{null}" noSelectionOption="true"></f:selectItem>
@@ -40,8 +37,29 @@
                                       itemLabel="#{item.text}" itemValue="#{item.key}"></f:selectItems>
                    </p:selectOneMenu>
                    <p:outputLabel value="管制品:"></p:outputLabel>
                    <p:selectOneMenu value="#{applyMngController.controlProduct}">
                        <f:selectItem itemLabel="全部" itemValue="#{null}" noSelectionOption="true"></f:selectItem>
                        <f:selectItem itemLabel="易制毒" itemValue="易制毒" ></f:selectItem>
                        <f:selectItem itemLabel="易制爆" itemValue="易制爆" ></f:selectItem>
                        <f:selectItem itemLabel="剧毒" itemValue="剧毒" ></f:selectItem>
                    </p:selectOneMenu>
                <style type="text/css">
                    .ui-selectonemenu.ui-widget.ui-state-default.ui-corner-all{
                        min-width: 30px !important;
                    }
                    #centerRootPanel .center-header .filter .ui-selectonemenu {
                        width: 73px !important;
                    }
                    #centerRootPanel .center-header .filter input {
                        height: 30px;
                        background-color: #eaeef7!important;
                        width: 120px !important;
                    }
                </style>
                    <p:commandLink styleClass="search" process="@form" update="@form"></p:commandLink>
                </p:row>
            </p:panelGrid>
        </p:panel>