Browse Source

修改入库申请记录表

lwx_dev
erdanergou 3 years ago
parent
commit
853e1a6ea9
  1. 12
      src/main/java/com/dreamchaser/depository_manage/controller/PageController.java
  2. 18
      src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml
  3. 26
      src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationInRecordP.java
  4. 14
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  5. 3
      src/main/java/com/dreamchaser/depository_manage/service/impl/SplitUnitServiceImpl.java
  6. 32
      src/main/resources/templates/pages/application/form-step-look.html
  7. 1
      src/main/resources/templates/pages/depository/table-in.html

12
src/main/java/com/dreamchaser/depository_manage/controller/PageController.java

@ -1454,6 +1454,18 @@ public class PageController {
placeCode = placeById.getCode();
}
Integer flagForGroup = applicationInRecordPById.getFlagForGroup();
if(Integer.compare(applicationInRecordPById.getAirapproverPass(),4) != 0){
String[] airapproverId = applicationInRecordPById.getAirapproverId().split(",");
StringBuilder airapproverName = new StringBuilder();
for (String approverId:airapproverId
) {
if(!"".equals(approverId)){
UserByPort userByPort = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(approverId), userToken);
airapproverName.append(userByPort.getName()).append(",");
}
}
applicationInRecordPById.setAirapproverName(airapproverName.toString());
}
mv.addObject("record", applicationInRecordPById);
mv.addObject("placeCode", placeCode);
if (Integer.compare(flagForGroup, 2) != 0) {

18
src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml

@ -65,8 +65,13 @@
<result column="munit" property="munit" jdbcType="VARCHAR"/>
<result column="mtexture" property="mtexture" jdbcType="VARCHAR"/>
<result column="mkingdeecode" property="mkingdeecode" jdbcType="VARCHAR"/>
<result column="mdepositoryCode" property="mdepositoryCode" jdbcType="VARCHAR"/>
<result column="airUnit" property="airUnit" jdbcType="VARCHAR"/>
<result column="mdepositoryCode" property="mdepositoryCode" jdbcType="VARCHAR"/>
<result column="airapproverPass" property="airapproverPass" jdbcType="INTEGER"/>
<result column="airapproverTime" property="airapproverTime" jdbcType="INTEGER"/>
<result column="airapproverId" property="airapproverId" jdbcType="VARCHAR"/>
<result column="airstate" property="airstate" jdbcType="VARCHAR"/>
<result column="airapproverMessage" property="airapproverMessage" jdbcType="VARCHAR"/>
</resultMap>
@ -141,7 +146,7 @@
</sql>
<sql id="ApplicationInRecordInfo">
airid,mname,quantity,price,tname,applicant_time,aircode,dname,applicant_id,applyRemark,mcode,mversion,munit,mtexture,mkingdeecode,mdepositoryCode,airUnit,flagForGroup,mid,airPlaceId
airid,mname,quantity,price,tname,applicant_time,aircode,dname,applicant_id,applyRemark,mcode,mversion,munit,mtexture,mkingdeecode,mdepositoryCode,airUnit,flagForGroup,mid,airPlaceId,airapproverPass,airapproverTime,airapproverId,airstate,airapproverMessage
</sql>
<sql id="ApplicationOutRecordInfo">
@ -878,7 +883,7 @@
<!-- 插入一条入库记录-->
<insert id="insertApplicationInRecord" parameterType="map" useGeneratedKeys="true" keyProperty="id">
insert into application_in_record (id,mid,quantity,price,applicant_id,applicant_time,depository_id,code,applyRemark,unit,flagForGroup,placeId)
insert into application_in_record (id,mid,quantity,price,applicant_id,applicant_time,depository_id,code,applyRemark,unit,flagForGroup,placeId,approverPass,approverTime,approverId,state,approverMessage)
values(
#{id},
#{mid},
@ -891,7 +896,12 @@
#{applyRemark},
#{unit},
#{flagForGroup},
#{placeId}
#{placeId},
#{approverPass},
#{approverTime},
#{approverId},
#{state},
#{approverMessage}
)
</insert>

26
src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationInRecordP.java

@ -106,4 +106,30 @@ public class ApplicationInRecordP {
*/
private Integer placeId;
/**
* 1通过2驳回3待审批4无需审批
*/
private Integer airapproverPass;
/**
* 审批时间
*/
private String airapproverTime;
/**
* 审批人id
*/
private String airapproverId;
/**
* 审批人姓名
*/
private String airapproverName;
/**
* 状态
*/
private String airstate;
/**
* 审批意见
*/
private String airapproverMessage;
}

14
src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

@ -106,6 +106,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
@Override
@Transactional(rollbackFor = Exception.class)
public Integer applicationIn(Map<String, Object> map) {
// 获取当前入库是否需要审批
Boolean flagForApproval = ObjectFormatUtil.toBoolean(map.get("flagForApproval"));
Integer depositoryId = ObjectFormatUtil.toInteger(map.get("depositoryId"));
Depository depositoryRecordById = depositoryMapper.findDepositoryById(depositoryId);
@ -149,7 +150,20 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 获取当前入库物料id
Integer newMid = 0;
if(!flagForApproval){
// 如果不需要审批
newMid = updateOrInsertInventory(map,materialByCondition,quantity,mid,depositoryId,producedDate);
map.put("approverPass",4);
map.put("state","已入库");
}else{
// 如果需要审批
List<RoleAndDepository> depositoryListForIn = roleService.findRoleAndDepositoryByDepositoryIdForIn(depositoryId);
map.put("approverPass",3);
StringBuilder approverId = new StringBuilder();
for (RoleAndDepository roleAndDepository : depositoryListForIn) {
approverId.append(roleAndDepository.getUserId()).append(",");
}
map.put("approverId",approverId.toString());
map.put("state","待审核");
}
// 将新入库的物料id记录下来

3
src/main/java/com/dreamchaser/depository_manage/service/impl/SplitUnitServiceImpl.java

@ -95,7 +95,7 @@ public class SplitUnitServiceImpl implements SplitUnitService {
if (roleAndDepositoryByCondition.size() > 0) {
flagForApproval = true;
}
map.put("flagForApproval",flagForApproval);
// 用于存储最终计算结果
Integer result = 0;
@ -168,6 +168,7 @@ public class SplitUnitServiceImpl implements SplitUnitService {
map.remove("applicationInId");
}else if("in".equals(type)){
// 如果是入库且需要审批
result = depositoryRecordService.applicationIn(map);
map.put("applicationInId",map.get("id"));
map.remove("id");

32
src/main/resources/templates/pages/application/form-step-look.html

@ -71,6 +71,24 @@
<td>申请备注</td>
<td id="applyRemarks" th:text="${record.getApplyRemark()}">2016-11-28</td>
</tr>
<tr>
<td>状态</td>
<td id="state" th:text="${record.getAirstate()}">2016-11-28</td>
<td style="display: none" id="approverpass" th:text="${record.getAirapproverPass()}">2016-11-28</td>
</tr>
<tr id="approverNameT" style="display: none">
<td>审批人</td>
<td id="approverName" th:text="${record.getAirapproverName()}">2016-11-28</td>
</tr>
<tr id="approverTimeT" style="display: none">
<td>审批时间</td>
<td id="approverTime" th:text="${record.getAirapproverTime()}">2016-11-28</td>
</tr>
<tr id="approverMessgaeT" style="display: none">
<td>审批意见</td>
<td id="approverMessgae" th:text="${record.getAirapproverMessage()}">2016-11-28</td>
</tr>
</tbody>
</table>
</div>
@ -85,6 +103,20 @@
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
layui.use(['form', 'table', 'laydate'], function () {
var $ = layui.jquery;
let approverPass = $("#approverpass").text();
if(approverPass !== "4"){
$("#approverNameT").show();
$("#approverMessgaeT").show();
let approverTime = $("#applicantTime");
if(approverTime.text() === ""){
approverTime.hide();
}else{
approverTime.show();
}
}
})
</script>
</body>
</html>

1
src/main/resources/templates/pages/depository/table-in.html

@ -167,6 +167,7 @@
{field: 'applicantName', width: 200, title: '提交人'},
{field: 'applicantTime', width: 200, title: '提交时间', sort: true},
{field: 'applyRemark', width: 200, title: '备注'},
{field: 'airstate', width: 200, title: '状态'},
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]
],

Loading…
Cancel
Save