Bläddra i källkod

增加性质转变单

gaodd 2 år sedan
förälder
incheckning
d597c3745d

+ 1 - 0
src/main/java/com/chinaitop/depot/DatePermissionInterceptor.java

@@ -78,6 +78,7 @@ public class DatePermissionInterceptor implements Interceptor {
78 78
 						!"com.chinaitop.depot.business.mapper.BusinessDeliveryStorageNoticeMapper.selectByPrimaryKey".equals(mappedStatement.getId()) &&
79 79
 						!"com.chinaitop.depot.business.mapper.BusinessDeliveryStorageNoticeMapper.selectByExample_COUNT".equals(mappedStatement.getId()) &&
80 80
 						!"com.chinaitop.depot.business.mapper.BusinessDeliveryStorageNoticeMapper.selectByExample".equals(mappedStatement.getId()) &&
81
+						!"com.chinaitop.depot.business.mapper.BusinessNoticeReceiveMapper.getUserRole_COUNT".equals(mappedStatement.getId()) &&
81 82
 						!"com.chinaitop.depot.business.mapper.BusinessMovelibraryMapper.selectList".equals(mappedStatement.getId())
82 83
 						){
83 84
 					//解析sql中的表名

+ 29 - 2
src/main/java/com/chinaitop/depot/business/controller/ReceiveNoticeController.java

@@ -77,10 +77,10 @@ public class ReceiveNoticeController {
77 77
 	
78 78
 	
79 79
 	/**
80
-	 * 启用、暂停、终止
80
+	 * 修改
81 81
 	 */
82 82
 	@RequestMapping(value="/update", produces = MediaType.APPLICATION_JSON_VALUE,method=RequestMethod.POST)
83
-    @ApiOperation(value="启用、暂停、终止", notes = "根据id修改状态(启用、暂停、终止)")
83
+    @ApiOperation(value="修改内容", notes = "修改内容")
84 84
     @ApiImplicitParams({
85 85
             @ApiImplicitParam(name = "BusinessNoticeReceive", value = "接收到的通知单对象", paramType = "query")
86 86
     })
@@ -117,5 +117,32 @@ public class ReceiveNoticeController {
117 117
 		}
118 118
 		return modelMap;
119 119
     }
120
+	
121
+	
122
+	/**
123
+	 * 未进行审核完成的【性质转变单】,该仓再下一次申请入库验收的时候,
124
+	 * 会提示,需要将上一次的粮食性质转变单审核完成,才能进行提交
125
+	 */
126
+	@RequestMapping(value="/getList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
127
+    @ApiOperation(value="入库验收申请时查询上一次性质转变单是否审批完成", notes = "入库验收申请时查询上一次性质转变单是否审批完成")
128
+    @ApiImplicitParams({
129
+            @ApiImplicitParam(name = "xybh", value = "协议编号", paramType = "query"),
130
+            @ApiImplicitParam(name = "sptDataId", value = "和市平台对接的货位编码", paramType = "query"),
131
+            @ApiImplicitParam(name = "flag", value = "是油罐还是仓房", paramType = "query")
132
+    })
133
+    public int getList(String xybh,String sptDataId,Integer flag) throws Exception {
134
+        return receiveNoticeService.queryIsOrAudit(xybh,sptDataId,flag);
135
+    }
136
+	
137
+	
138
+	@RequestMapping(value="/saveDataRk", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
139
+    @ApiOperation(value="增加性质转变单数据(入库)", notes = "增加性质转变单数据(入库)")
140
+	@ApiImplicitParams({
141
+        @ApiImplicitParam(name = "paramMap", value = "接收的数据", paramType = "query")
142
+    })
143
+    public void updateNoticeStatus(Map<String, Object> paramMap) {
144
+		receiveNoticeService.saveDataRk(paramMap);
145
+    	
146
+    }
120 147
     
121 148
 }

+ 189 - 0
src/main/java/com/chinaitop/depot/business/controller/audit/BusinessProSheetAuditController.java

@@ -0,0 +1,189 @@
1
+package com.chinaitop.depot.business.controller.audit;
2
+
3
+
4
+import com.chinaitop.depot.act.model.HistoryList;
5
+import com.chinaitop.depot.act.service.ActTaskService;
6
+import com.chinaitop.depot.business.model.BusinessApproval;
7
+import com.chinaitop.depot.business.model.BusinessFile;
8
+import com.chinaitop.depot.business.model.BusinessNoticeReceive;
9
+import com.chinaitop.depot.business.model.BusinessPlan;
10
+import com.chinaitop.depot.business.model.BusinessStoreWareDetail;
11
+import com.chinaitop.depot.business.model.enums.StoreWareType;
12
+import com.chinaitop.depot.business.model.vo.BusinessPlanAuditVO;
13
+import com.chinaitop.depot.business.service.BusinessApprovalService;
14
+import com.chinaitop.depot.business.service.BusinessFileService;
15
+import com.chinaitop.depot.business.service.BusinessPlanService;
16
+import com.chinaitop.depot.business.service.BusinessStoreWareDetailService;
17
+import com.chinaitop.depot.business.service.ReceiveNoticeService;
18
+import com.chinaitop.depot.utils.activiti.StringUtils;
19
+import com.fasterxml.jackson.core.JsonParseException;
20
+import com.fasterxml.jackson.databind.JsonMappingException;
21
+import com.fasterxml.jackson.databind.ObjectMapper;
22
+import com.github.pagehelper.PageHelper;
23
+import com.github.pagehelper.PageInfo;
24
+import io.swagger.annotations.Api;
25
+import io.swagger.annotations.ApiImplicitParam;
26
+import io.swagger.annotations.ApiImplicitParams;
27
+import io.swagger.annotations.ApiOperation;
28
+import org.springframework.beans.factory.annotation.Autowired;
29
+import org.springframework.http.MediaType;
30
+import org.springframework.web.bind.annotation.RequestMapping;
31
+import org.springframework.web.bind.annotation.RequestMethod;
32
+import org.springframework.web.bind.annotation.RestController;
33
+
34
+import javax.annotation.Resource;
35
+import javax.servlet.http.HttpServletRequest;
36
+import java.io.IOException;
37
+import java.text.SimpleDateFormat;
38
+import java.util.ArrayList;
39
+import java.util.Date;
40
+import java.util.HashMap;
41
+import java.util.List;
42
+import java.util.Map;
43
+
44
+/**
45
+ * 性质转变单审批
46
+ * @author My Sunshine
47
+ *
48
+ */
49
+@RestController
50
+@RequestMapping(value="/depot/business/propSheet/audit")
51
+@Api(value= "BusinessProSheetAuditController", description = "性质转变单审批管理")
52
+public class BusinessProSheetAuditController {
53
+    
54
+	@Resource
55
+	private ReceiveNoticeService receiveNoticeService;
56
+	
57
+    @Resource
58
+    private BusinessApprovalService businessApprovalService;
59
+    @Resource
60
+    private ActTaskService actTaskService;
61
+    
62
+    /**
63
+     * 获取审批列表.
64
+     * @param pageNum 页码
65
+     * @param pageSize 每页显示条数
66
+     * @return
67
+     */
68
+    @RequestMapping(value="/getList",  method=RequestMethod.GET)
69
+	@ApiOperation(value="获取性质转变单审批列表", notes = "查询数据列表,支持分页")
70
+	@ApiImplicitParams({
71
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
72
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
73
+		@ApiImplicitParam(name = "userId", value = "当前登录人的id", paramType = "query")
74
+	})
75
+    public PageInfo<BusinessNoticeReceive> getList(Integer pageNum, Integer pageSize,HttpServletRequest request,BusinessNoticeReceive businessNoticeReceive,Integer userId) {
76
+    	
77
+    	PageHelper.startPage(pageNum, pageSize);
78
+    	List<BusinessNoticeReceive> list = new ArrayList<BusinessNoticeReceive>();
79
+        
80
+        
81
+        List<Map<String,String>> userRoleList = receiveNoticeService.getUserRole(userId);
82
+        String roleNames = "";
83
+        for (Map<String, String> map : userRoleList) {
84
+        	String roleName =  map.get("role_name");
85
+        	roleNames = roleNames + roleName+",";
86
+		}
87
+       // System.out.println(roleNames);
88
+        List<BusinessNoticeReceive> listAll = receiveNoticeService.queryByExample(businessNoticeReceive);
89
+        for (BusinessNoticeReceive businessNoticeReceive2 : listAll) {
90
+        	//0仓储部经理审批 1质检部经理审批 2统计经理审批 3会计审批 4库领导审批
91
+			if(businessNoticeReceive2.getAuditState().equals(0)){
92
+				if(roleNames.contains("仓储部经理")){
93
+					list.add(businessNoticeReceive2);
94
+				}
95
+			 }
96
+			if(businessNoticeReceive2.getAuditState().equals(1)){
97
+				if(roleNames.contains("质检部经理")){
98
+					list.add(businessNoticeReceive2);
99
+				}
100
+			 }
101
+			if(businessNoticeReceive2.getAuditState().equals(2)){
102
+				if(roleNames.contains("统计部经理")){
103
+					list.add(businessNoticeReceive2);
104
+				}
105
+			 }
106
+			if(businessNoticeReceive2.getAuditState().equals(3)){
107
+				if(roleNames.contains("会计")){
108
+					list.add(businessNoticeReceive2);
109
+				}
110
+			 }
111
+			if(businessNoticeReceive2.getAuditState().equals(4)){
112
+				if(roleNames.contains("库领导")){
113
+					list.add(businessNoticeReceive2);
114
+				}
115
+			 }
116
+		}
117
+        
118
+        //PageHelper.startPage(pageNum, pageSize);
119
+        PageInfo<BusinessNoticeReceive> pageInfo = new PageInfo<BusinessNoticeReceive>(list);
120
+        /*if(pageInfo.getTotal()>0){
121
+        	pageInfo.setStartRow(pageInfo.getStartRow()+1);
122
+        	pageInfo.setEndRow(pageInfo.getEndRow()+1);
123
+        }*/
124
+        return pageInfo;
125
+    }
126
+    
127
+    /**
128
+     * 获取审批页面详情.
129
+     * @param id  业务主键
130
+     * @param processInstanceId 流程实例id
131
+     * @return
132
+     */
133
+    @RequestMapping(value="/getAudit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
134
+	@ApiOperation(value="获取审批页面详情", notes = "获取审批页面详情")
135
+	@ApiImplicitParams({
136
+		@ApiImplicitParam(name = "id", value = "原数据的id", paramType = "query")
137
+	})
138
+    public Map<String, Object> getAduit(Integer id) {
139
+        Map<String, Object> modelMap = new HashMap<String, Object>();
140
+        // 详情.
141
+        BusinessNoticeReceive businessNoticeReceive = receiveNoticeService.findById(id);
142
+        modelMap.put("businessNoticeReceive", businessNoticeReceive);
143
+        
144
+        modelMap.put("xzzbdh", businessNoticeReceive.getLsxzzbdh());
145
+        // 审批历史.
146
+        List<HistoryList> auditList = businessApprovalService.getAudit(modelMap);//该id是元数据的id 是中间表的project_id
147
+        modelMap.put("auditList", auditList);
148
+        
149
+        return modelMap;
150
+    }
151
+
152
+    /**
153
+     * 审批.
154
+     * @param planId 业务主键
155
+     * @param businessApproval 中间表
156
+     * @param assignee 下一个环节审批人
157
+     * @param result 当前环节审批结果
158
+     * @return
159
+     */
160
+    @RequestMapping(value="/audit", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
161
+	@ApiOperation(value="审批", notes = "审批")
162
+    @ApiImplicitParams({
163
+    	@ApiImplicitParam(name="receiveNoticeJson", value="原数据", paramType="form"),
164
+    	@ApiImplicitParam(name="content", value="审批意见", paramType="form"),
165
+    	@ApiImplicitParam(name="userId", value="当前登录人id", paramType="form"),
166
+    	@ApiImplicitParam(name="realName", value="前登录人姓名", paramType="form")
167
+    })
168
+    public Map<String, Object> audit(HttpServletRequest request, 
169
+    		String receiveNoticeJson, Integer userId, String realName,String orgName,String content) {
170
+        //UserInfo userInfo= (UserInfo) request.getSession().getAttribute("userInfo");
171
+        Map<String, Object> modelMap = new HashMap<String, Object>();
172
+        ObjectMapper mapper = new ObjectMapper();
173
+        BusinessNoticeReceive receiveNotice;
174
+		try {
175
+			receiveNotice = (BusinessNoticeReceive)mapper.readValue(receiveNoticeJson, BusinessNoticeReceive.class);
176
+			 receiveNoticeService.audit(receiveNotice, userId,  realName,orgName,content);
177
+		} catch (IOException e) {
178
+			// TODO Auto-generated catch block
179
+			e.printStackTrace();
180
+		}
181
+       
182
+        modelMap.put("status", "success");
183
+        return modelMap;
184
+    }
185
+
186
+ 
187
+
188
+    
189
+}

+ 3 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessApprovalMapper.java

@@ -1,5 +1,6 @@
1 1
 package com.chinaitop.depot.business.mapper;
2 2
 
3
+import com.chinaitop.depot.act.model.HistoryList;
3 4
 import com.chinaitop.depot.business.model.BusinessApproval;
4 5
 import com.chinaitop.depot.business.model.BusinessApprovalExample;
5 6
 import org.apache.ibatis.annotations.Param;
@@ -31,4 +32,6 @@ public interface BusinessApprovalMapper {
31 32
     int updateByPrimaryKey(BusinessApproval record);
32 33
 
33 34
 	List<BusinessApproval> queryByMap(Map<String, Object> map);
35
+
36
+	List<HistoryList> getAudit(Map<String, Object> modelMap);
34 37
 }

+ 20 - 1
src/main/java/com/chinaitop/depot/business/mapper/BusinessApprovalMapper.xml

@@ -739,6 +739,25 @@
739 739
          </if>
740 740
      </where>
741 741
      ORDER BY apply_time desc		
742
-
743 742
 	</select>
743
+	
744
+	<!-- <resultMap id="getAuditResultMap" type="com.chinaitop.depot.act.model.HistoryList" extends="BaseResultMap">
745
+    <result column="operator" property="assigneeName" jdbcType="VARCHAR" />
746
+    <result column="content" property="comment" jdbcType="VARCHAR" />
747
+    <result column="task_name" property="activityName" jdbcType="VARCHAR" />
748
+    <result column="apply_name" property="applyName" jdbcType="VARCHAR" />
749
+    <result column="from_department" property="department" jdbcType="VARCHAR" />
750
+   </resultMap> -->
751
+  <select id="getAudit" resultMap="BaseResultMap" parameterType="java.util.Map" >
752
+    SELECT
753
+      <include refid="Base_Column_List" />
754
+      FROM
755
+      business_approval 
756
+      <where>
757
+        <if test="xzzbdh != null">
758
+          task_type_name = #{xzzbdh,jdbcType=VARCHAR}
759
+        </if>
760
+        ORDER BY create_time ASC
761
+      </where>
762
+  </select>
744 763
 </mapper>

+ 4 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessNoticeReceiveMapper.java

@@ -3,6 +3,8 @@ package com.chinaitop.depot.business.mapper;
3 3
 import com.chinaitop.depot.business.model.BusinessNoticeReceive;
4 4
 import com.chinaitop.depot.business.model.BusinessNoticeReceiveExample;
5 5
 import java.util.List;
6
+import java.util.Map;
7
+
6 8
 import org.apache.ibatis.annotations.Param;
7 9
 
8 10
 public interface BusinessNoticeReceiveMapper {
@@ -93,4 +95,6 @@ public interface BusinessNoticeReceiveMapper {
93 95
      * @mbggenerated Wed Jul 08 09:57:43 CST 2020
94 96
      */
95 97
     int updateByPrimaryKey(BusinessNoticeReceive record);
98
+
99
+	List<Map<String, String>> getUserRole(Integer userId);
96 100
 }

+ 229 - 7
src/main/java/com/chinaitop/depot/business/mapper/BusinessNoticeReceiveMapper.xml

@@ -27,9 +27,24 @@
27 27
     <result column="grain_detail_kind" property="grainDetailKind" jdbcType="INTEGER" />
28 28
     <result column="receive_time" property="receiveTime" jdbcType="TIMESTAMP" />
29 29
     <result column="input_time" property="inputTime" jdbcType="TIMESTAMP" />
30
-     <result column="grain_annual" property="grainAnnual" jdbcType="INTEGER" />
30
+    <result column="grain_annual" property="grainAnnual" jdbcType="INTEGER" />
31 31
     <result column="productive_year" property="productiveYear" jdbcType="INTEGER" />
32
-     <result column="grain_producing_area" property="grainProducingArea" jdbcType="INTEGER" />
32
+    <result column="grain_producing_area" property="grainProducingArea" jdbcType="INTEGER" />
33
+     
34
+    <result column="lsxzzbdh" property="lsxzzbdh" jdbcType="VARCHAR" />
35
+    <result column="lssl" property="lssl" jdbcType="VARCHAR" />
36
+    <result column="hzqlsxzdm" property="hzqlsxzdm" jdbcType="INTEGER" />
37
+    <result column="hzrq" property="hzrq" jdbcType="TIMESTAMP" />
38
+    <result column="ccshr" property="ccshr" jdbcType="VARCHAR" />
39
+    <result column="zjshr" property="zjshr" jdbcType="VARCHAR" /> 
40
+    <result column="tjshr" property="tjshr" jdbcType="VARCHAR" /> 
41
+    <result column="kjshr" property="kjshr" jdbcType="VARCHAR" />  
42
+    <result column="ldshr" property="ldshr" jdbcType="VARCHAR" />
43
+    <result column="bz" property="bz" jdbcType="VARCHAR" />
44
+    <result column="audit_state" property="auditState" jdbcType="INTEGER" />
45
+    <result column="is_notice" property="isNotice" jdbcType="INTEGER" />
46
+    <result column="pzmc" property="pzmc" jdbcType="VARCHAR" />
47
+     
33 48
   </resultMap>
34 49
   <sql id="Example_Where_Clause" >
35 50
     <!--
@@ -107,7 +122,8 @@
107 122
     -->
108 123
     id, notice_number, crktype, contract_number, ywtype, house_id, ware_house_id, grain_kind, 
109 124
     grain_grade, count, outgoing_period, forwarding_unit, receive_unit, resion, in_application, 
110
-    org_id, grain_attribute, grain_detail_kind, receive_time,input_time,grain_annual,productive_year,grain_producing_area
125
+    org_id, grain_attribute, grain_detail_kind, receive_time,input_time,grain_annual,productive_year,grain_producing_area,
126
+    lsxzzbdh,lssl,hzqlsxzdm,hzrq,ccshr,zjshr,tjshr,kjshr,ldshr,bz,audit_state,is_notice,pzmc
111 127
   </sql>
112 128
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.BusinessNoticeReceiveExample" >
113 129
     <!--
@@ -171,7 +187,8 @@
171 187
       count, outgoing_period, forwarding_unit, 
172 188
       receive_unit, resion, in_application, 
173 189
       org_id, grain_attribute, grain_detail_kind, 
174
-      receive_time,input_time,grain_annual,productive_year,grain_producing_area)
190
+      receive_time,input_time,grain_annual,productive_year,grain_producing_area,
191
+      lsxzzbdh,lssl,hzqlsxzdm,hzrq,ccshr,zjshr,tjshr,kjshr,ldshr,bz,audit_state,is_notice,pzmc)
175 192
     values (#{id,jdbcType=INTEGER}, #{noticeNumber,jdbcType=VARCHAR}, #{crktype,jdbcType=VARCHAR}, 
176 193
       #{contractNumber,jdbcType=VARCHAR}, #{ywtype,jdbcType=VARCHAR}, #{houseId,jdbcType=INTEGER}, 
177 194
       #{wareHouseId,jdbcType=INTEGER}, #{grainKind,jdbcType=INTEGER}, #{grainGrade,jdbcType=INTEGER}, 
@@ -179,7 +196,11 @@
179 196
       #{receiveUnit,jdbcType=VARCHAR}, #{resion,jdbcType=VARCHAR}, #{inApplication,jdbcType=INTEGER}, 
180 197
       #{orgId,jdbcType=INTEGER}, #{grainAttribute,jdbcType=INTEGER}, #{grainDetailKind,jdbcType=INTEGER}, 
181 198
       #{receiveTime,jdbcType=TIMESTAMP},#{inputTime,jdbcType=TIMESTAMP},#{grainAnnual,jdbcType=INTEGER},
182
-      #{productiveYear,jdbcType=INTEGER},#{grainProducingArea,jdbcType=INTEGER})
199
+      #{productiveYear,jdbcType=INTEGER},#{grainProducingArea,jdbcType=INTEGER},
200
+      #{lsxzzbdh,jdbcType=VARCHAR},#{lssl,jdbcType=VARCHAR},#{hzqlsxzdm,jdbcType=INTEGER},
201
+      #{hzrq,jdbcType=TIMESTAMP},#{ccshr,jdbcType=VARCHAR},#{zjshr,jdbcType=VARCHAR},
202
+      #{tjshr,jdbcType=VARCHAR},#{kjshr,jdbcType=VARCHAR},#{ldshr,jdbcType=VARCHAR},
203
+      #{bz,jdbcType=VARCHAR},#{auditState,jdbcType=INTEGER},#{isNotice,jdbcType=INTEGER},#{pzmc,jdbcType=VARCHAR})
183 204
   </insert>
184 205
   <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessNoticeReceive" >
185 206
     <!--
@@ -258,6 +279,46 @@
258 279
       <if test="grainProducingArea != null" >
259 280
         grain_producing_area,
260 281
       </if>
282
+      <if test="lsxzzbdh != null" >
283
+        lsxzzbdh,
284
+      </if>
285
+      <if test="lssl != null" >
286
+        lssl,
287
+      </if>
288
+      <if test="hzqlsxzdm != null" >
289
+        hzqlsxzdm,
290
+      </if>
291
+      <if test="hzrq != null" >
292
+        hzrq,
293
+      </if>
294
+      <if test="ccshr != null" >
295
+        ccshr,
296
+      </if>
297
+      <if test="zjshr != null" >
298
+        zjshr,
299
+      </if>
300
+      <if test="tjshr != null" >
301
+        tjshr,
302
+      </if>
303
+      <if test="kjshr != null" >
304
+        kjshr,
305
+      </if>
306
+      <if test="ldshr != null" >
307
+        ldshr,
308
+      </if>
309
+      <if test="bz != null" >
310
+        bz,
311
+      </if>
312
+      <if test="auditState != null" >
313
+        audit_state,
314
+      </if>
315
+       <if test="isNotice != null" >
316
+        is_notice,
317
+      </if>
318
+      <if test="pzmc != null" >
319
+        pzmc,
320
+      </if>
321
+      
261 322
     </trim>
262 323
     <trim prefix="values (" suffix=")" suffixOverrides="," >
263 324
       <if test="id != null" >
@@ -329,6 +390,45 @@
329 390
       <if test="grainProducingArea != null" >
330 391
         #{grainProducingArea,jdbcType=INTEGER},
331 392
       </if>
393
+      <if test="lsxzzbdh != null" >
394
+        #{lsxzzbdh,jdbcType=VARCHAR},
395
+      </if>
396
+      <if test="lssl != null" >
397
+        #{lssl,jdbcType=VARCHAR},
398
+      </if>
399
+      <if test="hzqlsxzdm != null" >
400
+        #{hzqlsxzdm,jdbcType=INTEGER},
401
+      </if>
402
+      <if test="hzrq != null" >
403
+        #{hzrq,jdbcType=TIMESTAMP},
404
+      </if>
405
+      <if test="ccshr != null" >
406
+        #{ccshr,jdbcType=VARCHAR},
407
+      </if>
408
+      <if test="zjshr != null" >
409
+         #{zjshr,jdbcType=VARCHAR},
410
+      </if>
411
+      <if test="tjshr != null" >
412
+         #{tjshr,jdbcType=VARCHAR},
413
+      </if>
414
+      <if test="kjshr != null" >
415
+         #{kjshr,jdbcType=VARCHAR},
416
+      </if>
417
+      <if test="ldshr != null" >
418
+         #{ldshr,jdbcType=VARCHAR},
419
+      </if>
420
+      <if test="bz != null" >
421
+         #{bz,jdbcType=VARCHAR},
422
+      </if>
423
+      <if test="auditState != null" >
424
+         #{auditState,jdbcType=INTEGER},
425
+      </if>
426
+      <if test="isNotice != null" >
427
+         #{isNotice,jdbcType=INTEGER},
428
+      </if>
429
+      <if test="pzmc != null" >
430
+         #{pzmc,jdbcType=VARCHAR},
431
+      </if>
332 432
     </trim>
333 433
   </insert>
334 434
   <select id="countByExample" parameterType="com.chinaitop.depot.business.model.BusinessNoticeReceiveExample" resultType="java.lang.Integer" >
@@ -419,6 +519,46 @@
419 519
       <if test="record.grainProducingArea != null" >
420 520
         grain_producing_area = #{record.grainProducingArea,jdbcType=INTEGER},
421 521
       </if>
522
+      
523
+      <if test="record.lsxzzbdh != null" >
524
+        lsxzzbdh = #{record.lsxzzbdh,jdbcType=VARCHAR},
525
+      </if>
526
+      <if test="record.lssl != null" >
527
+        lssl = #{record.lssl,jdbcType=VARCHAR},
528
+      </if>
529
+      <if test="record.hzqlsxzdm != null" >
530
+        hzqlsxzdm = #{record.hzqlsxzdm,jdbcType=INTEGER},
531
+      </if>
532
+      <if test="record.hzrq != null" >
533
+        hzrq = #{record.hzrq,jdbcType=TIMESTAMP},
534
+      </if>
535
+      <if test="record.ccshr != null" >
536
+        ccshr = #{record.ccshr,jdbcType=VARCHAR},
537
+      </if>
538
+      <if test="record.zjshr != null" >
539
+        zjshr = #{record.zjshr,jdbcType=VARCHAR},
540
+      </if>
541
+      <if test="record.tjshr != null" >
542
+        tjshr = #{record.tjshr,jdbcType=VARCHAR},
543
+      </if>
544
+      <if test="record.kjshr != null" >
545
+        kjshr = #{record.kjshr,jdbcType=VARCHAR},
546
+      </if>
547
+      <if test="record.ldshr != null" >
548
+        ldshr = #{record.ldshr,jdbcType=VARCHAR},
549
+      </if>
550
+      <if test="record.bz != null" >
551
+        bz = #{record.bz,jdbcType=VARCHAR},
552
+      </if>
553
+      <if test="record.auditState != null" >
554
+        audit_state = #{record.auditState,jdbcType=INTEGER},
555
+      </if>
556
+      <if test="record.isNotice != null" >
557
+        is_notice = #{record.isNotice,jdbcType=INTEGER},
558
+      </if>
559
+      <if test="record.pzmc != null" >
560
+        pzmc = #{record.pzmc,jdbcType=VARCHAR},
561
+      </if>
422 562
     </set>
423 563
     <if test="_parameter != null" >
424 564
       <include refid="Update_By_Example_Where_Clause" />
@@ -453,7 +593,20 @@
453 593
       input_time = #{record.inputTime,jdbcType=TIMESTAMP},
454 594
       grain_annual = #{record.grainAnnual,jdbcType=INTEGER},
455 595
       productive_year = #{record.productiveYear,jdbcType=INTEGER},
456
-      grain_producing_area = #{record.grainProducingArea,jdbcType=INTEGER}
596
+      grain_producing_area = #{record.grainProducingArea,jdbcType=INTEGER},
597
+      lsxzzbdh = #{record.lsxzzbdh,jdbcType=VARCHAR},
598
+      lssl = #{record.lssl,jdbcType=VARCHAR},
599
+      hzqlsxzdm = #{record.hzqlsxzdm,jdbcType=INTEGER},
600
+      hzrq = #{record.hzrq,jdbcType=TIMESTAMP},
601
+      ccshr = #{record.ccshr,jdbcType=VARCHAR},
602
+      zjshr = #{record.zjshr,jdbcType=VARCHAR},
603
+      tjshr = #{record.tjshr,jdbcType=VARCHAR},
604
+      kjshr = #{record.kjshr,jdbcType=VARCHAR},
605
+      ldshr = #{record.ldshr,jdbcType=VARCHAR},
606
+      bz = #{record.bz,jdbcType=VARCHAR},
607
+      audit_state = #{record.auditState,jdbcType=INTEGER},
608
+      is_notice = #{record.isNotice,jdbcType=INTEGER},
609
+      pzmc = #{record.pzmc,jdbcType=VARCHAR}
457 610
       
458 611
     <if test="_parameter != null" >
459 612
       <include refid="Update_By_Example_Where_Clause" />
@@ -533,6 +686,46 @@
533 686
       <if test="grainProducingArea != null" >
534 687
         grain_producing_area = #{grainProducingArea,jdbcType=INTEGER},
535 688
       </if>
689
+      
690
+       <if test="lsxzzbdh != null" >
691
+        lsxzzbdh = #{lsxzzbdh,jdbcType=VARCHAR},
692
+      </if>
693
+      <if test="lssl != null" >
694
+        lssl = #{lssl,jdbcType=VARCHAR},
695
+      </if>
696
+      <if test="hzqlsxzdm != null" >
697
+        hzqlsxzdm = #{hzqlsxzdm,jdbcType=INTEGER},
698
+      </if>
699
+      <if test="hzrq != null" >
700
+        hzrq = #{hzrq,jdbcType=TIMESTAMP},
701
+      </if>
702
+      <if test="ccshr != null" >
703
+        ccshr = #{ccshr,jdbcType=VARCHAR},
704
+      </if>
705
+      <if test="zjshr != null" >
706
+        zjshr = #{zjshr,jdbcType=VARCHAR},
707
+      </if>
708
+      <if test="tjshr != null" >
709
+        tjshr = #{tjshr,jdbcType=VARCHAR},
710
+      </if>
711
+      <if test="kjshr != null" >
712
+        kjshr = #{kjshr,jdbcType=VARCHAR},
713
+      </if>
714
+      <if test="ldshr != null" >
715
+        ldshr = #{ldshr,jdbcType=VARCHAR},
716
+      </if>
717
+      <if test="bz != null" >
718
+        bz = #{bz,jdbcType=VARCHAR},
719
+      </if>
720
+      <if test="auditState != null" >
721
+        audit_state = #{auditState,jdbcType=INTEGER},
722
+      </if>
723
+      <if test="isNotice != null" >
724
+        is_notice = #{isNotice,jdbcType=INTEGER},
725
+      </if>
726
+      <if test="pzmc != null" >
727
+        pzmc = #{pzmc,jdbcType=VARCHAR},
728
+      </if>
536 729
     </set>
537 730
     where id = #{id,jdbcType=INTEGER}
538 731
   </update>
@@ -564,7 +757,36 @@
564 757
       input_time = #{inputTime,jdbcType=TIMESTAMP},
565 758
       grain_annual = #{grainAnnual,jdbcType=INTEGER},
566 759
       productive_year = #{productiveYear,jdbcType=INTEGER},
567
-      grain_producing_area = #{grainProducingArea,jdbcType=INTEGER}
760
+      grain_producing_area = #{grainProducingArea,jdbcType=INTEGER},
761
+      lsxzzbdh = #{lsxzzbdh,jdbcType=VARCHAR},
762
+      lssl = #{lssl,jdbcType=VARCHAR},
763
+      hzqlsxzdm = #{hzqlsxzdm,jdbcType=INTEGER},
764
+      hzrq = #{hzrq,jdbcType=TIMESTAMP},
765
+      ccshr = #{ccshr,jdbcType=VARCHAR},
766
+      zjshr = #{zjshr,jdbcType=VARCHAR},
767
+      tjshr = #{tjshr,jdbcType=VARCHAR},
768
+      kjshr = #{kjshr,jdbcType=VARCHAR},
769
+      ldshr = #{ldshr,jdbcType=VARCHAR},
770
+      bz = #{bz,jdbcType=VARCHAR},
771
+      audit_state = #{auditState,jdbcType=INTEGER},
772
+      is_notice = #{isNotice,jdbcType=INTEGER},
773
+      pzmc = #{pzmc,jdbcType=VARCHAR}
568 774
     where id = #{id,jdbcType=INTEGER}
569 775
   </update>
776
+  
777
+   <select id="getUserRole" parameterType="java.lang.Integer" resultType="java.util.HashMap">
778
+  		SELECT
779
+			role_name
780
+		FROM
781
+			role_info
782
+		WHERE
783
+			role_id IN (
784
+				SELECT
785
+					role_id
786
+				FROM
787
+					user_role
788
+				WHERE
789
+					user_id = #{userId,jdbcType=INTEGER}
790
+			)
791
+  </select>
570 792
 </mapper>

+ 123 - 1
src/main/java/com/chinaitop/depot/business/model/BusinessNoticeReceive.java

@@ -5,8 +5,130 @@ import java.util.Date;
5 5
 import com.fasterxml.jackson.annotation.JsonFormat;
6 6
 
7 7
 public class BusinessNoticeReceive {
8
+		
9
+		//表里新增字段
10
+	  private String lsxzzbdh;
11
+	  private String lssl;
12
+	  private Integer hzqlsxzdm;
13
+	  @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
14
+	  private Date hzrq;//划转日期
15
+	  private String ccshr;
16
+	  private String zjshr;
17
+	  private String tjshr;
18
+	  private String kjshr;
19
+	  private String ldshr;
20
+	  private String bz;
21
+	  private Integer auditState;
22
+	  private Integer isNotice;
23
+	  private String pzmc;
24
+	  
25
+	
8 26
 	
9
-	    //业务字段
27
+	public String getPzmc() {
28
+		return pzmc;
29
+	}
30
+
31
+	public void setPzmc(String pzmc) {
32
+		this.pzmc = pzmc;
33
+	}
34
+
35
+	public Integer getIsNotice() {
36
+		return isNotice;
37
+	}
38
+
39
+	public void setIsNotice(Integer isNotice) {
40
+		this.isNotice = isNotice;
41
+	}
42
+
43
+	public String getLsxzzbdh() {
44
+		return lsxzzbdh;
45
+	}
46
+
47
+	public void setLsxzzbdh(String lsxzzbdh) {
48
+		this.lsxzzbdh = lsxzzbdh;
49
+	}
50
+
51
+	public String getLssl() {
52
+		return lssl;
53
+	}
54
+
55
+	public void setLssl(String lssl) {
56
+		this.lssl = lssl;
57
+	}
58
+
59
+	public Integer getHzqlsxzdm() {
60
+		return hzqlsxzdm;
61
+	}
62
+
63
+	public void setHzqlsxzdm(Integer hzqlsxzdm) {
64
+		this.hzqlsxzdm = hzqlsxzdm;
65
+	}
66
+
67
+	public Date getHzrq() {
68
+		return hzrq;
69
+	}
70
+
71
+	public void setHzrq(Date hzrq) {
72
+		this.hzrq = hzrq;
73
+	}
74
+
75
+	public String getCcshr() {
76
+		return ccshr;
77
+	}
78
+
79
+	public void setCcshr(String ccshr) {
80
+		this.ccshr = ccshr;
81
+	}
82
+
83
+	public String getZjshr() {
84
+		return zjshr;
85
+	}
86
+
87
+	public void setZjshr(String zjshr) {
88
+		this.zjshr = zjshr;
89
+	}
90
+
91
+	public String getTjshr() {
92
+		return tjshr;
93
+	}
94
+
95
+	public void setTjshr(String tjshr) {
96
+		this.tjshr = tjshr;
97
+	}
98
+
99
+	public String getKjshr() {
100
+		return kjshr;
101
+	}
102
+
103
+	public void setKjshr(String kjshr) {
104
+		this.kjshr = kjshr;
105
+	}
106
+
107
+	public String getLdshr() {
108
+		return ldshr;
109
+	}
110
+
111
+	public void setLdshr(String ldshr) {
112
+		this.ldshr = ldshr;
113
+	}
114
+
115
+	public String getBz() {
116
+		return bz;
117
+	}
118
+
119
+	public void setBz(String bz) {
120
+		this.bz = bz;
121
+	}
122
+
123
+	public Integer getAuditState() {
124
+		return auditState;
125
+	}
126
+
127
+	public void setAuditState(Integer auditState) {
128
+		this.auditState = auditState;
129
+	}
130
+
131
+		//业务字段
10 132
 		private String outCount;
11 133
 		private String outRemainingNumber;
12 134
 		private boolean checked;

+ 33 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessNoticeReceiveExample.java

@@ -195,6 +195,39 @@ public class BusinessNoticeReceiveExample {
195 195
             criteria.add(new Criterion(condition, value1, value2));
196 196
         }
197 197
 
198
+        
199
+        
200
+        public Criteria andCcshrEqualTo(String value) {
201
+            addCriterion("ccshr =", value, "ccshr");
202
+            return (Criteria) this;
203
+        }
204
+        
205
+        public Criteria andZjshrEqualTo(String value) {
206
+            addCriterion("zjshr =", value, "zjshr");
207
+            return (Criteria) this;
208
+        }
209
+        public Criteria andTjshrEqualTo(String value) {
210
+            addCriterion("tjshr =", value, "tjshr");
211
+            return (Criteria) this;
212
+        }
213
+        public Criteria andKjshrEqualTo(String value) {
214
+            addCriterion("kjshr =", value, "kjshr");
215
+            return (Criteria) this;
216
+        }
217
+        public Criteria andLdshrEqualTo(String value) {
218
+            addCriterion("ldshr =", value, "ldshr");
219
+            return (Criteria) this;
220
+        }
221
+        public Criteria andAuditStateEqualTo(Integer value) {
222
+            addCriterion("audit_state =", value, "auditState");
223
+            return (Criteria) this;
224
+        }
225
+        public Criteria andIsNoticeEqualTo(Integer value) {
226
+            addCriterion("is_notice =", value, "isNotice");
227
+            return (Criteria) this;
228
+        }
229
+        
230
+        
198 231
         public Criteria andIdIsNull() {
199 232
             addCriterion("id is null");
200 233
             return (Criteria) this;

+ 114 - 1
src/main/java/com/chinaitop/depot/business/model/BusinessStoreWareDetail.java

@@ -114,6 +114,18 @@ public class BusinessStoreWareDetail {
114 114
     private int expiredOrNot;//是否超过出入库期限 1是0否
115 115
     private String outboundExpirationDate;//出库期限(区间)
116 116
     
117
+    private String lsxzzbdh;
118
+    private String lssl;
119
+    private Integer hzqlsxzdm;
120
+    private Date hzrq;
121
+    private String ccshr;
122
+    private String zjshr;
123
+    private String tjshr;
124
+    private String kjshr;
125
+    private String ldshr;
126
+    private String bz;
127
+    private Integer auditState;
128
+    private Integer isNotice;
117 129
     
118 130
     
119 131
     
@@ -121,8 +133,109 @@ public class BusinessStoreWareDetail {
121 133
     
122 134
     
123 135
     
136
+    
137
+    
138
+    
139
+    
140
+    
141
+
142
+    public String getLsxzzbdh() {
143
+		return lsxzzbdh;
144
+	}
145
+
146
+	public void setLsxzzbdh(String lsxzzbdh) {
147
+		this.lsxzzbdh = lsxzzbdh;
148
+	}
149
+
150
+	public String getLssl() {
151
+		return lssl;
152
+	}
153
+
154
+	public void setLssl(String lssl) {
155
+		this.lssl = lssl;
156
+	}
157
+
158
+	public Integer getHzqlsxzdm() {
159
+		return hzqlsxzdm;
160
+	}
161
+
162
+	public void setHzqlsxzdm(Integer hzqlsxzdm) {
163
+		this.hzqlsxzdm = hzqlsxzdm;
164
+	}
165
+
166
+	public Date getHzrq() {
167
+		return hzrq;
168
+	}
169
+
170
+	public void setHzrq(Date hzrq) {
171
+		this.hzrq = hzrq;
172
+	}
173
+
174
+	public String getCcshr() {
175
+		return ccshr;
176
+	}
177
+
178
+	public void setCcshr(String ccshr) {
179
+		this.ccshr = ccshr;
180
+	}
181
+
182
+	public String getZjshr() {
183
+		return zjshr;
184
+	}
185
+
186
+	public void setZjshr(String zjshr) {
187
+		this.zjshr = zjshr;
188
+	}
189
+
190
+	public String getTjshr() {
191
+		return tjshr;
192
+	}
193
+
194
+	public void setTjshr(String tjshr) {
195
+		this.tjshr = tjshr;
196
+	}
197
+
198
+	public String getKjshr() {
199
+		return kjshr;
200
+	}
201
+
202
+	public void setKjshr(String kjshr) {
203
+		this.kjshr = kjshr;
204
+	}
205
+
206
+	public String getLdshr() {
207
+		return ldshr;
208
+	}
209
+
210
+	public void setLdshr(String ldshr) {
211
+		this.ldshr = ldshr;
212
+	}
213
+
214
+	public String getBz() {
215
+		return bz;
216
+	}
217
+
218
+	public void setBz(String bz) {
219
+		this.bz = bz;
220
+	}
221
+
222
+	public Integer getAuditState() {
223
+		return auditState;
224
+	}
225
+
226
+	public void setAuditState(Integer auditState) {
227
+		this.auditState = auditState;
228
+	}
229
+
230
+	public Integer getIsNotice() {
231
+		return isNotice;
232
+	}
233
+
234
+	public void setIsNotice(Integer isNotice) {
235
+		this.isNotice = isNotice;
236
+	}
124 237
 
125
-    public String getOutboundExpirationDate() {
238
+	public String getOutboundExpirationDate() {
126 239
 		return outboundExpirationDate;
127 240
 	}
128 241
 

+ 4 - 0
src/main/java/com/chinaitop/depot/business/service/BusinessApprovalService.java

@@ -1,5 +1,6 @@
1 1
 package com.chinaitop.depot.business.service;
2 2
 
3
+import com.chinaitop.depot.act.model.HistoryList;
3 4
 import com.chinaitop.depot.business.model.BusinessApproval;
4 5
 import com.chinaitop.depot.business.model.BusinessApprovalExample;
5 6
 
@@ -33,4 +34,7 @@ public interface BusinessApprovalService {
33 34
     //待办已办
34 35
 	List<BusinessApproval> queryByMap(Map<String, Object> map);
35 36
 
37
+	List<HistoryList> getAudit(Map<String, Object> modelMap);
38
+
39
+
36 40
 }

+ 8 - 0
src/main/java/com/chinaitop/depot/business/service/FeignBasicService.java

@@ -20,4 +20,12 @@ public interface FeignBasicService {
20 20
     @RequestMapping(value = "/Enum/getIdByNameAndParentId", method = RequestMethod.GET)
21 21
     Map<String, Object> getIdByNameAndParentId(@RequestParam(value = "parentId") Integer parentId,@RequestParam(value = "enumName") String enumName, @RequestParam(value = "gbCode") String gbCode);
22 22
 
23
+    
24
+    @RequestMapping(value = "/Warehouse/getHouseIdBySptDataID", method = RequestMethod.GET)
25
+    String getHouseIdBySptDataID(@RequestParam(value = "sptDataId") String sptDataId);
26
+    
27
+    @RequestMapping(value = "/Tank/getTankIdBySptDataID", method = RequestMethod.GET)
28
+    String getTankIdBySptDataID(@RequestParam(value = "sptDataId") String sptDataId);
29
+
30
+
23 31
 }

+ 9 - 1
src/main/java/com/chinaitop/depot/business/service/ReceiveNoticeService.java

@@ -17,6 +17,14 @@ public interface ReceiveNoticeService {
17 17
 
18 18
 	Map<String, Object> receiveNotice(String notice) throws Exception;
19 19
 
20
-	
20
+	List<BusinessNoticeReceive> queryByExample(BusinessNoticeReceive businessNoticeReceive);
21 21
 
22
+	List<Map<String, String>> getUserRole(Integer userId);
23
+
24
+	void audit(BusinessNoticeReceive receiveNotice, Integer userId, String realName,String orgName,String content);
25
+
26
+	int queryIsOrAudit(String xybh, String sptDataId,Integer flag);
27
+
28
+	void saveDataRk(Map<String, Object> paramMap);
29
+			
22 30
 }

+ 7 - 0
src/main/java/com/chinaitop/depot/business/service/impl/BusinessApprovalServiceImpl.java

@@ -1,5 +1,6 @@
1 1
 package com.chinaitop.depot.business.service.impl;
2 2
 
3
+import com.chinaitop.depot.act.model.HistoryList;
3 4
 import com.chinaitop.depot.business.mapper.BusinessApprovalMapper;
4 5
 import com.chinaitop.depot.business.model.BusinessApproval;
5 6
 import com.chinaitop.depot.business.model.BusinessApprovalExample;
@@ -57,4 +58,10 @@ public class BusinessApprovalServiceImpl implements BusinessApprovalService {
57 58
 		return businessApprovalMapper.queryByMap(map);
58 59
 	}
59 60
 
61
+	@Override
62
+	public List<HistoryList> getAudit(Map<String, Object> modelMap) {
63
+		// TODO Auto-generated method stub
64
+		return businessApprovalMapper.getAudit(modelMap);
65
+	}
66
+
60 67
 }

+ 200 - 1
src/main/java/com/chinaitop/depot/business/service/impl/ReceiveNoticeServiceImpl.java

@@ -1,5 +1,7 @@
1 1
 package com.chinaitop.depot.business.service.impl;
2 2
 
3
+import java.math.BigDecimal;
4
+import java.text.SimpleDateFormat;
3 5
 import java.util.Date;
4 6
 import java.util.HashMap;
5 7
 import java.util.List;
@@ -14,9 +16,11 @@ import org.springframework.stereotype.Service;
14 16
 
15 17
 import com.alibaba.fastjson.JSONObject;
16 18
 import com.chinaitop.depot.business.mapper.BusinessNoticeReceiveMapper;
19
+import com.chinaitop.depot.business.model.BusinessApproval;
17 20
 import com.chinaitop.depot.business.model.BusinessNoticeReceive;
18 21
 import com.chinaitop.depot.business.model.BusinessNoticeReceiveExample;
19 22
 import com.chinaitop.depot.business.model.BusinessNoticeReceiveExample.Criteria;
23
+import com.chinaitop.depot.business.service.BusinessApprovalService;
20 24
 import com.chinaitop.depot.business.service.FeignAgileService;
21 25
 import com.chinaitop.depot.business.service.FeignBasicService;
22 26
 import com.chinaitop.depot.business.service.ReceiveNoticeService;
@@ -32,6 +36,11 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
32 36
 	private FeignBasicService feignBasicService;
33 37
 	@Resource
34 38
 	private FeignAgileService feignAgileService;
39
+	@Resource
40
+    private BusinessApprovalService businessApprovalService;
41
+    /*@Resource
42
+    private BusinessApprovalMapper approvalMapper;*/
43
+
35 44
 	
36 45
 	// 获取ip地址
37 46
     @Value("${crk-webservice}")
@@ -99,6 +108,14 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
99 108
         if(businessNoticeReceive.getGrainGrade()!=null){
100 109
         	createCriteria.andGrainGradeEqualTo(businessNoticeReceive.getGrainGrade());
101 110
         }
111
+        //审批通过的
112
+        if(businessNoticeReceive.getAuditState() != null){
113
+        	createCriteria.andAuditStateEqualTo(businessNoticeReceive.getAuditState());
114
+        }
115
+        //是否是可以引用的通知单
116
+        if(businessNoticeReceive.getIsNotice()!=null){
117
+        	createCriteria.andIsNoticeEqualTo(businessNoticeReceive.getIsNotice());
118
+        }
102 119
         if(pageNum!=null && pageSize!=null){
103 120
         	PageHelper.startPage(pageNum, pageSize);
104 121
         }
@@ -215,6 +232,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
215 232
                                 Integer grainGrade = (Integer) map.get("dj"); //等级
216 233
                                 String inputTime = map.get("rq")+""; //入库时间
217 234
                                 Integer scnf = Integer.parseInt(map.get("scnf")+"");
235
+                                Double kcsl = (Double) map.get("kcsl");//千克
218 236
                                 Date date = null;
219 237
                                 if(inputTime!=null){
220 238
                                     date = ParameterUtil.string2datetime(inputTime);
@@ -230,6 +248,20 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
230 248
                                 businessNoticeReceive.setGrainGrade(grainGrade); //等级
231 249
                                 businessNoticeReceive.setGrainAttribute(grainAttribute); //粮油性质
232 250
                                 businessNoticeReceive.setGrainProducingArea(grainProducingArea);//产地
251
+                                
252
+                                /**
253
+                                 * 库存数量转化为吨
254
+                                 */
255
+                                BigDecimal s = new BigDecimal(1000);
256
+                                BigDecimal kcslBig = new BigDecimal(kcsl);
257
+                                BigDecimal kcslKg = kcslBig.multiply(s);
258
+                                
259
+                                businessNoticeReceive.setLssl(kcslKg.toString());//库存数量
260
+                                
261
+                                businessNoticeReceive.setHzqlsxzdm(3052);//商品粮
262
+                                businessNoticeReceive.setLsxzzbdh(jsonObject.getString("tzdid"));
263
+                                //SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
264
+                                businessNoticeReceive.setHzrq(new Date());
233 265
 
234 266
                             }
235 267
                             String  lsyqsl = jsonObject.getString("lsyqsl");
@@ -242,7 +274,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
242 274
                             businessNoticeReceive.setOutgoingPeriod(jsonObject.getString("ckqx")); //出库期限(日期格式)
243 275
 
244 276
                             businessNoticeReceive.setInApplication(1); //启用
245
-
277
+                            businessNoticeReceive.setIsNotice(0);//0是可以引用的通知单
246 278
                             businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
247 279
                             businessNoticeReceiveMapper.insert(businessNoticeReceive);
248 280
                         }
@@ -305,4 +337,171 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
305 337
 		return modelMap;
306 338
 	}
307 339
 
340
+
341
+
342
+	@Override
343
+	public List<BusinessNoticeReceive> queryByExample(BusinessNoticeReceive businessNoticeReceive) {
344
+		// TODO Auto-generated method stub
345
+		
346
+		
347
+		BusinessNoticeReceiveExample example = new BusinessNoticeReceiveExample();
348
+        Criteria createCriteria = example.createCriteria();
349
+        
350
+        //仓房
351
+        if(businessNoticeReceive.getHouseId()!=null){
352
+        	createCriteria.andHouseIdEqualTo(businessNoticeReceive.getHouseId());
353
+        }
354
+        //货位
355
+        if(businessNoticeReceive.getWareHouseId()!=null){
356
+        	createCriteria.andWareHouseIdEqualTo(businessNoticeReceive.getWareHouseId());
357
+        }
358
+        
359
+      //货位
360
+        if(businessNoticeReceive.getOrgId()!=null){
361
+        	createCriteria.andOrgIdEqualTo(businessNoticeReceive.getOrgId());
362
+        }
363
+        
364
+        example.setOrderByClause("receive_time desc");
365
+        List<BusinessNoticeReceive> selectByExample = businessNoticeReceiveMapper.selectByExample(example);
366
+        return selectByExample;
367
+        
368
+	}
369
+
370
+
371
+
372
+	@Override
373
+	public List<Map<String, String>> getUserRole(Integer userId) {
374
+		// TODO Auto-generated method stub
375
+		return businessNoticeReceiveMapper.getUserRole(userId);
376
+	}
377
+
378
+
379
+
380
+	@Override
381
+	public void audit(BusinessNoticeReceive receiveNotice, Integer userId, String realName,String orgName,String content) {
382
+		// TODO Auto-generated method stub
383
+		
384
+        //businessApproval.setContent(jsonUserInfo.getString("realName") + "提交"); //提交人
385
+        
386
+		BusinessApproval businessApproval = new BusinessApproval();
387
+		businessApproval.setOperateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));//操作时间
388
+        businessApproval.setOperator(userId+"");//已选择的审批人id
389
+        businessApproval.setOperatorName(realName);//已选择的审批人姓名
390
+        businessApproval.setCreateTime(new Date()); //创建时间
391
+        businessApproval.setFromDepartment(orgName); //部门 orgName
392
+    	businessApproval.setProjectName("性质转变单审批");//名称
393
+        businessApproval.setTaskType("propertyTS");//任务类型
394
+    	businessApproval.setResult("同意");//审批结果
395
+    	businessApproval.setApplyTime(receiveNotice.getReceiveTime());//申请时间
396
+        businessApproval.setTaskTypeName(receiveNotice.getLsxzzbdh());//任务类型名
397
+        businessApproval.setIsHide(0);//
398
+        businessApproval.setContent(content);//审批意见
399
+        businessApproval.setProjectId(receiveNotice.getId());
400
+        if(receiveNotice.getAuditState().equals(0)){//仓储部审批
401
+        	//更改该条数据
402
+        	receiveNotice.setCcshr(userId+"");
403
+        	receiveNotice.setAuditState(1);
404
+        	businessNoticeReceiveMapper.updateByPrimaryKeySelective(receiveNotice);
405
+        	
406
+        	//审批表数据的新增
407
+            businessApproval.setTaskName("仓储部经理审批");//任务名称
408
+
409
+        }else{
410
+        	
411
+        	if(receiveNotice.getAuditState().equals(1)){//质检审批
412
+        		receiveNotice.setAuditState(2);
413
+        		receiveNotice.setZjshr(userId+"");
414
+        		businessApproval.setTaskName("质检部经理审批");//任务名称
415
+        		
416
+        	}else if(receiveNotice.getAuditState().equals(2)){//统计审批
417
+        		receiveNotice.setAuditState(3);
418
+        		receiveNotice.setTjshr(userId+"");
419
+        		businessApproval.setTaskName("统计部经理审批");//任务名称
420
+        		
421
+        	}else if(receiveNotice.getAuditState().equals(3)){//会计审批
422
+        		receiveNotice.setAuditState(4);
423
+        		receiveNotice.setKjshr(userId+"");
424
+        		businessApproval.setTaskName("会计部经理审批");//任务名称
425
+        	}else if(receiveNotice.getAuditState().equals(4)){//库领导审批
426
+        		receiveNotice.setAuditState(5);//审批完毕
427
+        		receiveNotice.setLdshr(userId+"");
428
+        		businessApproval.setTaskName("库领导审批");//任务名称
429
+        	}
430
+        	
431
+        	//修改本条数据
432
+        	businessNoticeReceiveMapper.updateByPrimaryKeySelective(receiveNotice);
433
+
434
+        }
435
+       //增加审批表数据
436
+    	businessApprovalService.add(businessApproval);
437
+        
438
+		
439
+	}
440
+
441
+
442
+
443
+	@Override
444
+	public int queryIsOrAudit(String xybh, String sptDataId,Integer flag) {
445
+		// TODO Auto-generated method stub
446
+		String houseId = "0";
447
+		if(flag.equals(0)){//油罐
448
+			 houseId =feignBasicService.getTankIdBySptDataID(sptDataId);
449
+		}else if(flag.equals(1)){//仓房
450
+			 houseId = feignBasicService.getHouseIdBySptDataID(sptDataId);
451
+		}
452
+		
453
+		//根据仓房或者油罐id 查询是否有为完成审批的性质转变单
454
+		BusinessNoticeReceiveExample example = new BusinessNoticeReceiveExample();
455
+        Criteria createCriteria = example.createCriteria();
456
+        createCriteria.andHouseIdEqualTo(Integer.valueOf(houseId));
457
+        createCriteria.andContractNumberEqualTo(xybh);
458
+        example.setOrderByClause("receive_time desc");
459
+        List<BusinessNoticeReceive> list = businessNoticeReceiveMapper.selectByExample(example);
460
+		if(list.size()>0 && !list.get(0).getAuditState().equals(5)){
461
+			return 0;//存在
462
+		}else{
463
+			return 1;//不存在
464
+		}
465
+		
466
+	}
467
+
468
+
469
+
470
+	@Override
471
+	public void saveDataRk(Map<String, Object> paramMap) {
472
+		// TODO Auto-generated method stub
473
+        
474
+		BusinessNoticeReceive businessNoticeReceive = new BusinessNoticeReceive();
475
+        String orgId = (String) paramMap.get("orgId");
476
+        Integer storehouseId =  (Integer) paramMap.get("storehouseId");
477
+        Integer warehouseId =  (Integer) paramMap.get("warehouseId");
478
+        String pzmc = (String) paramMap.get("pzmc");
479
+        String hzsl = (String) paramMap.get("hzsl");
480
+        String lsxzzbdh = (String) paramMap.get("lsxzzbdh");
481
+		Map<String, Object> map = feignAgileService.getDateByChHwh(Integer.valueOf(orgId), storehouseId, warehouseId);
482
+		Integer grainKind = (Integer) map.get("pz"); //品种
483
+        Double kcsl = (Double) map.get("kcsl");//千克
484
+        
485
+        businessNoticeReceive.setAuditState(0);//下发未审批
486
+        businessNoticeReceive.setIsNotice(1);//0是1否  是否是可以引用的通知单
487
+        businessNoticeReceive.setOrgId(Integer.valueOf(orgId));
488
+        businessNoticeReceive.setHouseId(storehouseId);
489
+        businessNoticeReceive.setWareHouseId(warehouseId);
490
+        businessNoticeReceive.setCount(hzsl);
491
+        businessNoticeReceive.setPzmc(pzmc);
492
+        businessNoticeReceive.setGrainKind(grainKind);
493
+        businessNoticeReceive.setGrainAttribute(3045); 
494
+        businessNoticeReceive.setHzqlsxzdm(3052);
495
+        businessNoticeReceive.setLsxzzbdh(lsxzzbdh);
496
+        businessNoticeReceive.setNoticeNumber(lsxzzbdh);
497
+        businessNoticeReceive.setCrktype("1"); //1入 3出
498
+        BigDecimal s = new BigDecimal(1000);
499
+        BigDecimal kcslBig = new BigDecimal(kcsl);
500
+        BigDecimal kcslKg = kcslBig.multiply(s);
501
+        businessNoticeReceive.setLssl(kcslKg.toString());//库存数量
502
+        businessNoticeReceive.setHzrq(new Date());
503
+        businessNoticeReceiveMapper.insertSelective(businessNoticeReceive);
504
+		
505
+	}
506
+
308 507
 }

+ 14 - 0
src/main/java/com/chinaitop/depot/utils/HelloServiceHystrix.java

@@ -85,4 +85,18 @@ public class HelloServiceHystrix implements FeignAgileService,FeignBasicService{
85 85
 		return null;
86 86
 	}
87 87
 
88
+	@Override
89
+	public String getHouseIdBySptDataID(String sptDataId) {
90
+		// TODO Auto-generated method stub
91
+		logger.info("获取仓房ID失败!");
92
+		return null;
93
+	}
94
+
95
+	@Override
96
+	public String getTankIdBySptDataID(String sptDataId) {
97
+		// TODO Auto-generated method stub
98
+		logger.info("获取油罐ID失败!");
99
+		return null;
100
+	}
101
+
88 102
 }