Browse Source

完成pc端与移动端页面的更新

lwx_dev
erdanergou 3 years ago
parent
commit
d566827fce
  1. 1
      pom.xml
  2. 5
      src/main/java/com/dreamchaser/depository_manage/entity/Material.java
  3. 8
      src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml
  4. 256
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  5. 4
      src/main/resources/application-test.yml
  6. 2
      src/main/resources/static/css/public.css
  7. BIN
      src/main/resources/static/images/search.png
  8. 6
      src/main/resources/static/js/lay-module/step-lay/step.css
  9. 12
      src/main/resources/static/js/lay-module/step-lay/step.js
  10. 8
      src/main/resources/templates/index.html
  11. 13
      src/main/resources/templates/pages/application/application-review.html
  12. 1
      src/main/resources/templates/pages/application/application-transfer.html
  13. 146
      src/main/resources/templates/pages/application/my-apply.html
  14. 89
      src/main/resources/templates/pages/application/my-task.html
  15. 32
      src/main/resources/templates/pages/application/my-task_back.html
  16. 4
      target/classes/application-test.yml
  17. 8
      target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml
  18. 2
      target/classes/static/css/public.css
  19. BIN
      target/classes/static/images/search.png
  20. 6
      target/classes/static/js/lay-module/step-lay/step.css
  21. 12
      target/classes/static/js/lay-module/step-lay/step.js
  22. 8
      target/classes/templates/index.html
  23. 13
      target/classes/templates/pages/application/application-review.html
  24. 1
      target/classes/templates/pages/application/application-transfer.html
  25. 146
      target/classes/templates/pages/application/my-apply.html
  26. 89
      target/classes/templates/pages/application/my-task.html
  27. 32
      target/classes/templates/pages/application/my-task_back.html

1
pom.xml

@ -176,6 +176,7 @@
</dependency>
</dependencies>
<dependencyManagement>

5
src/main/java/com/dreamchaser/depository_manage/entity/Material.java

@ -61,4 +61,9 @@ public class Material {
*/
private String depositoryCode;
/**
* 暂存额度
*/
private Integer numberOfTemporary;
}

8
src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml

@ -18,6 +18,7 @@
<result column="amounts" property="amounts" jdbcType="DOUBLE"/>
<result column="unit" property="unit" jdbcType="VARCHAR"/>
<result column="texture" property="texture" jdbcType="VARCHAR"/>
<result column="number_of_temporary" property="numberOfTemporary" jdbcType="VARCHAR"/>
</resultMap>
<!-- 字段映射-->
@ -50,7 +51,7 @@
<!-- 表查询字段 -->
<sql id="allColumns">
m.id, m.depository_id, m.mname, m.quantity, m.price, m.type_id,m.state,m.code ,m.version ,m.amounts ,m.unit ,m.texture,m.depositoryCode
m.id, m.depository_id, m.mname, m.quantity, m.price, m.type_id,m.state,m.code ,m.version ,m.amounts ,m.unit ,m.texture,m.depositoryCode,m.number_of_temporary
</sql>
<!-- 表查询字段,包括材料类型 -->
@ -244,7 +245,10 @@
unit = #{unit},
</if>
<if test="depositoryCode != null and depositoryCode !=''">
depositoryCode = #{depositoryCode}
depositoryCode = #{depositoryCode},
</if>
<if test="numberOfTemporary != null and numberOfTemporary != ''">
number_of_temporary = #{numberOfTemporary}
</if>
</set>
WHERE id = #{id}

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

@ -19,7 +19,10 @@ import com.dreamchaser.depository_manage.utils.WordUtil;
import org.apache.http.protocol.HTTP;
import org.springframework.beans.Mergeable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.data.redis.core.RedisOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.SessionCallback;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import cn.hutool.core.lang.Snowflake;
@ -28,6 +31,7 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @author Dreamchaser
@ -47,7 +51,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
@Autowired
private RoleService roleService;
@Autowired
private RedisTemplate<String,String> redisTemplate;
private RedisTemplate<String, String> redisTemplate;
/**
* 提交申请插入一条仓库调度记录
@ -72,61 +76,64 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
/**
* 插入一条入库记录
*
* @param map
* @return
*/
@Override
public Integer applicationIn(Map<String, Object> map) {
Integer depositoryId =ObjectFormatUtil.toInteger(map.get("depositoryId"));
Integer depositoryId = ObjectFormatUtil.toInteger(map.get("depositoryId"));
Depository depositoryRecordById = depositoryMapper.findDepositoryRecordById(depositoryId);
Map<String,Object> temp = new HashMap<>();
temp.put("dname",depositoryRecordById.getDname());
temp.put("dcode",depositoryRecordById.getCode());
Map<String, Object> temp = new HashMap<>();
temp.put("dname", depositoryRecordById.getDname());
temp.put("dcode", depositoryRecordById.getCode());
Double Inventory = depositoryMapper.getToDayInventoryByDName(temp);
String code = createCode(depositoryRecordById.getDname(),"InOrderNumber");
String code = createCode(depositoryRecordById.getDname(), "InOrderNumber");
Double quantity = Double.parseDouble((String) map.get("quantity"));
Integer mid = ObjectFormatUtil.toInteger(map.get("mid"));
Material material = materialMapper.findMaterialById(mid);
// 判断剩余容量是否可以存入
if(depositoryRecordById.getMaxNumber() - Inventory <quantity){
if (depositoryRecordById.getMaxNumber() - Inventory < quantity) {
return 0;
}
Map<String,Object> param = new HashMap<>();
param.put("depositoryId",depositoryId);
param.put("mname",material.getMname());
Map<String, Object> param = new HashMap<>();
param.put("depositoryId", depositoryId);
param.put("mname", material.getMname());
List<Material> materialByCondition = materialMapper.findMaterialByCondition(param);
// 计算当前入库材料金额
int amounts = (int) ((material.getPrice() / 100) * quantity * 100);
map.put("price", amounts);
String simpleTime = DateUtil.getSimpleTime(new Date());
map.put("applicant_time",DateUtil.DateTimeToTimeStamp(simpleTime));
map.put("code",code);
map.put("applicant_time", DateUtil.DateTimeToTimeStamp(simpleTime));
map.put("code", code);
// 获取当前材料
if(materialByCondition.size() > 0){ // 如果当前存在
if (materialByCondition.size() > 0) { // 如果当前存在
Material mt = materialByCondition.get(0);
mt.setAmounts(mt.getAmounts() + amounts);
mt.setQuantity((int) (mt.getQuantity() + quantity));
materialMapper.updateMaterial(mt);
}else{
Map<String,Object> insert = new HashMap<>();
} else {
Map<String, Object> insert = new HashMap<>();
Material materialById = materialMapper.findMaterialById(mid);
insert.put("depositoryId",depositoryId);
insert.put("price",materialById.getPrice());
insert.put("mname",materialById.getMname());
insert.put("quantity",quantity);
insert.put("materialTypeId",materialById.getTypeId());
insert.put("code",materialById.getCode());
insert.put("unit",materialById.getUnit());
insert.put("version",materialById.getVersion());
insert.put("texture",materialById.getTexture());
insert.put("amounts",quantity * materialById.getPrice());
insert.put("depositoryCode",materialById.getDepositoryCode());
insert.put("depositoryId", depositoryId);
insert.put("price", materialById.getPrice());
insert.put("mname", materialById.getMname());
insert.put("quantity", quantity);
insert.put("materialTypeId", materialById.getTypeId());
insert.put("code", materialById.getCode());
insert.put("unit", materialById.getUnit());
insert.put("version", materialById.getVersion());
insert.put("texture", materialById.getTexture());
insert.put("amounts", quantity * materialById.getPrice());
insert.put("depositoryCode", materialById.getDepositoryCode());
materialMapper.insertMaterial(insert);
}
return depositoryRecordMapper.insertApplicationInRecord(map);
}
/**
* 插入一条出库记录
*
* @param map
* @return
*/
@ -134,19 +141,23 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
public Integer insertApplicationOutRecord(Map<String, Object> map) {
Double quantity = Double.parseDouble((String) map.get("quantity"));
Long time = DateUtil.DateTimeToTimeStamp(DateUtil.getSimpleTime(new Date()));
map.put("applicantTime",time);
map.put("applicantTime", time);
Integer mid = ObjectFormatUtil.toInteger(map.get("mid"));
// 获取当前材料
Material materialById = materialMapper.findMaterialById(mid);
int amounts = (int) ((materialById.getPrice() / 100) * quantity * 100);
map.put("price", amounts);
String simpleTime = DateUtil.getSimpleTime(new Date());
map.put("depositoryId",materialById.getDepositoryId());
map.put("state","待部门负责人审核");
map.put("istransfer",2);
map.put("depositoryId", materialById.getDepositoryId());
map.put("state", "待部门负责人审核");
map.put("istransfer", 2);
Map<String, Object> update = new HashMap<>();
update.put("id", materialById.getId());
update.put("numberOfTemporary", materialById.getNumberOfTemporary() + quantity);
materialMapper.updateMaterial(update);
Depository depositoryRecordById = depositoryMapper.findDepositoryRecordById(materialById.getDepositoryId());
String code = createCode(depositoryRecordById.getDname(),"outOrderNumber");
map.put("code",code);
String code = createCode(depositoryRecordById.getDname(), "outOrderNumber");
map.put("code", code);
return depositoryRecordMapper.insertApplicationOutRecord(map);
}
@ -162,6 +173,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
/**
* 计算购入材料总数
*
* @return
*/
@Override
@ -169,13 +181,14 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
List<ApplicationInRecordP> applicationInRecordPAll = depositoryRecordMapper.findApplicationInRecordPAll();
Double sum = 0.0;
for (int i = 0; i < applicationInRecordPAll.size(); i++) {
sum += (double)applicationInRecordPAll.get(i).getQuantity();
sum += (double) applicationInRecordPAll.get(i).getQuantity();
}
return sum;
}
/**
* 计算出库材料总数
*
* @param state
* @return
*/
@ -185,13 +198,13 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
Double sum = 0.0;
if (state.isEmpty()) {
for (int i = 0; i < applicationOutRecordPAll.size(); i++) {
sum += (double) applicationOutRecordPAll.get(i).getQuantity();
sum += (double) applicationOutRecordPAll.get(i).getQuantity();
}
} else {
for (int i = 0; i < applicationOutRecordPAll.size(); i++) {
if ( state.equals(applicationOutRecordPAll.get(i).getState())) {
sum += (double)applicationOutRecordPAll.get(i).getQuantity();
if (state.equals(applicationOutRecordPAll.get(i).getState())) {
sum += (double) applicationOutRecordPAll.get(i).getQuantity();
}
}
}
@ -210,21 +223,21 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
Integer mid = ObjectFormatUtil.toInteger(map.get("mid"));
Double quantity = Double.parseDouble((String) map.get("quantity"));
Material material = materialMapper.findMaterialById(mid);
map.put("depositoryId",material.getDepositoryId());
map.put("depositoryId", material.getDepositoryId());
map.put("mid", mid);
map.put("state", "待部门负责人审核");
String simpleTime = DateUtil.getSimpleTime(new Date());
map.put("applicantTime", DateUtil.DateTimeToTimeStamp(simpleTime));
map.put("price", material.getPrice() * quantity * 100);
map.put("istransfer",1);
map.put("istransfer", 1);
map.put("fromId", material.getDepositoryId());
//清除主键
// depositoryRecordMapper.insertApplicationInRecord(map);
transferRecordMapper.addTransferRecord(map);
TransferRecord transferRecordByCondition = transferRecordMapper.findTransferRecordByCondition(map).get(0);
map.put("transferId",transferRecordByCondition.getId());
map.put("transferId", transferRecordByCondition.getId());
Depository depositoryRecordById = depositoryMapper.findDepositoryRecordById(material.getDepositoryId());
map.put("code",createCode(depositoryRecordById.getDname(),"outOrderNumber"));
map.put("code", createCode(depositoryRecordById.getDname(), "outOrderNumber"));
//清除主键
return depositoryRecordMapper.insertApplicationOutRecord(map);
}
@ -252,12 +265,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
UserByPort userByPort = PageController.FindUserById(userIdByDidList.get(i));
depositoryManager += userByPort.getId().toString() + ",";
}
map.put("depositoryManager",depositoryManager);
map.put("depositoryManager", depositoryManager);
} else {
map.put("state", "部门负责人审核未通过");
}
}
else {
} else {
String simpleTime = DateUtil.getSimpleTime(new Date());
map.put("depositoryManagerTime", DateUtil.DateTimeToTimeStamp(simpleTime));
map.put("depositoryManager", userid);
@ -266,25 +278,30 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
Material material = materialMapper.findMaterialById(record.getMid());
Integer depositoryManagerPass = (Integer) map.get("depositoryManagerPass");
if (depositoryManagerPass == 1) {
if (material.getQuantity() >= record.getQuantity()) {
// 当前出库金额
Double sum = material.getPrice() * record.getQuantity();
material.setAmounts(material.getAmounts() - sum);
material.setQuantity(material.getQuantity() - record.getQuantity());
materialMapper.updateMaterial(material);
if(record.getIstransfer() == 1){
map.put("quantity",record.getQuantity().toString());
map.put("applicantId",record.getApplicantId());
map.put("transferId",record.getTransferId());
transferMaterial(map);
}
} else {
map.put("state","未出库");
map.put("depositoryManagerMessage","当前仓位库存量不足");
depositoryRecordMapper.updateApplicationOutRecord(map);
return -1;
if (material.getQuantity() >= record.getQuantity()) {
// 当前出库金额
Double sum = material.getPrice() * record.getQuantity();
material.setAmounts(material.getAmounts() - sum);
material.setQuantity(material.getQuantity() - record.getQuantity());
material.setNumberOfTemporary(material.getNumberOfTemporary() - record.getQuantity());
materialMapper.updateMaterial(material);
if (record.getIstransfer() == 1) {
map.put("quantity", record.getQuantity().toString());
map.put("applicantId", record.getApplicantId());
map.put("transferId", record.getTransferId());
transferMaterial(map);
}
map.put("state", "已出库");
} else {
map.put("state", "未出库");
map.put("depositoryManagerMessage", "当前仓位库存量不足");
Map<String, Object> update = new HashMap<>();
update.put("id", material.getId());
update.put("numberOfTemporary", 0);
materialMapper.updateMaterial(update);
depositoryRecordMapper.updateApplicationOutRecord(map);
return -1;
}
map.put("state", "已出库");
} else {
map.put("state", "仓库管理员审核未通过");
}
@ -294,36 +311,37 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
/**
* 转移物品
*
* @param map
*/
public void transferMaterial(Map<String,Object> map){
Map<String,Object> param = new HashMap<>();
public void transferMaterial(Map<String, Object> map) {
Map<String, Object> param = new HashMap<>();
Integer transferId = ObjectFormatUtil.toInteger(map.get("transferId"));
TransferRecord transferRecor = transferRecordMapper.findTransferRecordById(transferId);
Integer mid = transferRecor.getMid();
Integer mid = transferRecor.getMid();
Material material = materialMapper.findMaterialById(mid);
param.put("mname",material.getMname());
param.put("depositoryId",transferRecor.getToId());
param.put("mname", material.getMname());
param.put("depositoryId", transferRecor.getToId());
List<Material> materiallist = materialMapper.findMaterialByCondition(param);
if(materiallist.size() > 0){
map.put("depositoryId",transferRecor.getToId());
if (materiallist.size() > 0) {
map.put("depositoryId", transferRecor.getToId());
applicationIn(map);
map.put("mid",materiallist.get(0).getId());
}else{
Map<String,Object> insert = new HashMap<>();
map.put("mid", materiallist.get(0).getId());
} else {
Map<String, Object> insert = new HashMap<>();
Material materialById = materialMapper.findMaterialById(mid);
Integer quantity = ObjectFormatUtil.toInteger(map.get("quantity"));
insert.put("depositoryId",transferRecor.getToId());
insert.put("price",materialById.getPrice());
insert.put("mname",materialById.getMname());
insert.put("quantity",quantity);
insert.put("materialTypeId",materialById.getTypeId());
insert.put("code",materialById.getCode());
insert.put("unit",materialById.getUnit());
insert.put("version",materialById.getVersion());
insert.put("texture",materialById.getTexture());
insert.put("amounts",quantity * materialById.getPrice());
insert.put("depositoryCode",materialById.getDepositoryCode());
insert.put("depositoryId", transferRecor.getToId());
insert.put("price", materialById.getPrice());
insert.put("mname", materialById.getMname());
insert.put("quantity", quantity);
insert.put("materialTypeId", materialById.getTypeId());
insert.put("code", materialById.getCode());
insert.put("unit", materialById.getUnit());
insert.put("version", materialById.getVersion());
insert.put("texture", materialById.getTexture());
insert.put("amounts", quantity * materialById.getPrice());
insert.put("depositoryCode", materialById.getDepositoryCode());
materialMapper.insertMaterial(insert);
}
}
@ -388,6 +406,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
/**
* 根据条件查询入库记录同时支持分页查询
*
* @param map
* @return
*/
@ -402,9 +421,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
page = ObjectFormatUtil.toInteger(map.get("page"));
map.put("begin", (page - 1) * size);
}
if(map.containsKey("applyTime")){
if (map.containsKey("applyTime")) {
String applyTime = (String) map.get("applyTime");
map.put("applicantTime",DateUtil.DateTimeByMonthToTimeStamp(applyTime));
map.put("applicantTime", DateUtil.DateTimeByMonthToTimeStamp(applyTime));
}
List<ApplicationInRecordP> list = depositoryRecordMapper.findApplicationInRecordPByCondition(map);
for (int i = 0; i < list.size(); i++) {
@ -412,12 +431,14 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
String time = DateUtil.TimeStampToDateTime(Long.valueOf(list.get(i).getApplicantTime()));
list.get(i).setApplicantName(userByPortById.getName());
list.get(i).setApplicantTime(time);
list.get(i).setApplyRemark(list.get(i).getApplyRemark() == null?"":list.get(i).getApplyRemark());
list.get(i).setApplyRemark(list.get(i).getApplyRemark() == null ? "" : list.get(i).getApplyRemark());
}
return list;
}
/**
* 根据条件查询出库记录同时支持分页查询
*
* @param map
* @return
*/
@ -432,9 +453,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
page = ObjectFormatUtil.toInteger(map.get("page"));
map.put("begin", (page - 1) * size);
}
if(map.containsKey("applyTime")){
if (map.containsKey("applyTime")) {
String applyTime = (String) map.get("applyTime");
map.put("applicantTime",DateUtil.DateTimeByMonthToTimeStamp(applyTime));
map.put("applicantTime", DateUtil.DateTimeByMonthToTimeStamp(applyTime));
}
List<ApplicationOutRecordP> list = depositoryRecordMapper.findApplicationOutRecordPByCondition(map);
for (int i = 0; i < list.size(); i++) {
@ -442,13 +463,14 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
String time = DateUtil.TimeStampToDateTime(Long.valueOf(list.get(i).getApplicantTime()));
list.get(i).setApplicantName(userByPortById.getName());
list.get(i).setApplicantTime(time);
list.get(i).setApplyRemark(list.get(i).getApplyRemark() == null?"":list.get(i).getApplyRemark());
list.get(i).setApplyRemark(list.get(i).getApplyRemark() == null ? "" : list.get(i).getApplyRemark());
}
return list;
}
/**
* 根据条件查询出库记录数目
*
* @param map
* @return
*/
@ -459,6 +481,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
/**
* 根据id查询出库记录
*
* @param id
* @return
*/
@ -469,6 +492,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
/**
* 根据条件查询入库记录数目
*
* @param map
* @return
*/
@ -539,6 +563,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
public Integer findMyTaskCount(Map<String, Object> map) {
return depositoryRecordMapper.findMyTaskCount(map);
}
/**
* 返回该我的任务数完成或者未完成
*
@ -571,19 +596,19 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
Double sum = 0.0;
if (state.isEmpty()) {
for (int i = 0; i < depositoryRecordAll.size(); i++) {
if (Integer.compare(depositoryRecordAll.get(i).getType(),type) == 0) {
if (Integer.compare(depositoryRecordAll.get(i).getType(), type) == 0) {
sum += depositoryRecordAll.get(i).getQuantity();
}
}
} else {
for (int i = 0; i < depositoryRecordAll.size(); i++) {
if (Integer.compare(depositoryRecordAll.get(i).getType(),type) == 0 && state.equals(depositoryRecordAll.get(i).getState())) {
if (Integer.compare(depositoryRecordAll.get(i).getType(), type) == 0 && state.equals(depositoryRecordAll.get(i).getState())) {
sum += depositoryRecordAll.get(i).getQuantity();
}
}
}
BigDecimal bg = new BigDecimal(sum);
sum = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
sum = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
return sum;
}
@ -599,24 +624,25 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
Double sum = 0.0;
if (state.isEmpty()) {
for (int i = 0; i < depositoryRecordAll.size(); i++) {
if (Integer.compare(depositoryRecordAll.get(i).getType(),type) == 0) {
if (Integer.compare(depositoryRecordAll.get(i).getType(), type) == 0) {
sum += (depositoryRecordAll.get(i).getPrice() / 100);
}
}
} else {
for (int i = 0; i < depositoryRecordAll.size(); i++) {
if (Integer.compare(depositoryRecordAll.get(i).getType(),type) == 0 && state.equals(depositoryRecordAll.get(i).getState())) {
if (Integer.compare(depositoryRecordAll.get(i).getType(), type) == 0 && state.equals(depositoryRecordAll.get(i).getState())) {
sum += (depositoryRecordAll.get(i).getPrice() / 100);
}
}
}
BigDecimal bg = new BigDecimal(sum);
sum = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
sum = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
return sum;
}
/**
* 计算入库材料总额
*
* @return
*/
@Override
@ -625,15 +651,16 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
Double sum = 0.0;
for (int i = 0; i < applicationInRecordPAll.size(); i++) {
double price = applicationInRecordPAll.get(i).getPrice();
sum += price/100;
sum += price / 100;
}
BigDecimal bg = new BigDecimal(sum);
sum = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
sum = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
return sum;
}
/**
* 计算出库材料总额
*
* @param state
* @return
*/
@ -644,19 +671,19 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
if (state.isEmpty()) {
for (int i = 0; i < applicationOutRecordPAll.size(); i++) {
Double price = applicationOutRecordPAll.get(i).getPrice();
sum += (double)( price/ 100);
sum += (double) (price / 100);
}
} else {
for (int i = 0; i < applicationOutRecordPAll.size(); i++) {
if ( state.equals(applicationOutRecordPAll.get(i).getState())) {
if (state.equals(applicationOutRecordPAll.get(i).getState())) {
Double price = applicationOutRecordPAll.get(i).getPrice();
sum += (double)( price/ 100);
sum += (double) (price / 100);
}
}
}
BigDecimal bg = new BigDecimal(sum);
sum = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
sum = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
return sum;
}
@ -701,7 +728,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
map.put("depositoryId", depositoryId);
if (type == 1) {
return depositoryRecordMapper.findApplicationInRecordByDate(map);
} else{
} else {
map.put("state", "已出库");
return depositoryRecordMapper.findApplicationOutRecordByDate(map);
}
@ -763,10 +790,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
@Override
public Double findMaterialCountByMonth1(Map<String, Object> map) {
Integer type = ObjectFormatUtil.toInteger(map.get("type"));
if(type == 1){
if (type == 1) {
// 如果入库
return depositoryRecordMapper.findApplicationInByMonth(map);
}else{
} else {
// 如果出库
return depositoryRecordMapper.findApplicationOutByMonth(map);
}
@ -784,6 +811,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
/**
* 根据id查询入库记录
*
* @param id
* @return
*/
@ -794,8 +822,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
/**
* 根据id删除入库记录
* @return 受影响的行数
*
* @param id
* @return 受影响的行数
*/
@Override
public Integer deleteApplicationInRecordById(Integer id) {
@ -804,6 +833,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
/**
* 根据id集合删除多条入库记录
*
* @param list id集合
* @return 受影响的行数
*/
@ -813,7 +843,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}
/**
* 对查出来的记录进行包装包装成前端需要的数据
*
@ -842,7 +871,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
for (SimpleApplicationOutRecord record : list) {
SimpleApplicationOutRecordP d = new SimpleApplicationOutRecordP(record);
UserByPort userByPort = findUserByPortById(record.getApplicantId());
d.setApplyRemark(d.getApplyRemark() == null?"":d.getApplyRemark());
d.setApplyRemark(d.getApplyRemark() == null ? "" : d.getApplyRemark());
d.setApplicantName(userByPort.getName());
result.add(d);
}
@ -881,11 +910,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
/**
* 根据id获取对应用户
*
* @param id
* @return
*/
private UserByPort findUserByPortById(Integer id) {
String url = PortConfig.external_url + "/staff/archivescont";
String url = PortConfig.external_url + "/staff/archivescont";
Map<String, Object> map = new HashMap<>();
map.put("id", id);
String jsonString = JSONObject.toJSONString(map);
@ -898,27 +928,29 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}
JSONObject jsonObject = JSONObject.parseObject(post);
JSONObject data = (JSONObject) jsonObject.get("data");
UserByPort userByPort = JSONObject.toJavaObject( data, UserByPort.class);
UserByPort userByPort = JSONObject.toJavaObject(data, UserByPort.class);
return userByPort;
}
/**
* 生成单号
*
* @param depositoryName
* @return
*/
private String createCode(String depositoryName,String key){
private String createCode(String depositoryName, String key) {
// 单号(公司简称+仓库简称+年月日+数字(位数设置>=9))
String code = "GK";
String nowTime = DateUtil.getNowTime();
depositoryName = WordUtil.getPinYinHeadChar(depositoryName);
String orderNumber = redisTemplate.opsForValue().get(key);
if(orderNumber == null){
redisTemplate.opsForValue().set(key,"1",DateUtil.getSecondsNextEarlyMorning(), TimeUnit.SECONDS);
if (orderNumber == null) {
redisTemplate.opsForValue().set(key, "1", DateUtil.getSecondsNextEarlyMorning(), TimeUnit.SECONDS);
orderNumber = "1";
}
int newNumber = ObjectFormatUtil.toInteger(orderNumber) + 1;
redisTemplate.boundValueOps(key).set(String.valueOf(newNumber),DateUtil.getSecondsNextEarlyMorning(), TimeUnit.SECONDS);
redisTemplate.boundValueOps(key).set(String.valueOf(newNumber), DateUtil.getSecondsNextEarlyMorning(), TimeUnit.SECONDS);
orderNumber = String.format("%09d", ObjectFormatUtil.toInteger(orderNumber));
code = code + depositoryName + nowTime + orderNumber;
return code;

4
src/main/resources/application-test.yml

@ -80,6 +80,10 @@ spring:
min-idle: 0
timeout: 2000ms
# resources:
# static-locations: classpath:/static/
server:

2
src/main/resources/static/css/public.css

@ -82,7 +82,7 @@ body {
}
.my-time{
margin-top: 20px;
margin-top: 40px;
margin-bottom: 20px;
}
body{

BIN
src/main/resources/static/images/search.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

6
src/main/resources/static/js/lay-module/step-lay/step.css

@ -3,6 +3,7 @@
width: 400px;
margin: 0 auto;
max-width: 100%;
text-align: center;
}
.step-item {
@ -54,8 +55,9 @@
.step-item-main {
display: block;
position: relative;
margin-left: -50%;
margin-right: 50%;
/*margin-left: -20px;*/
/*margin-left: -50%;*/
/*margin-right: 50%;*/
padding-left: 26px;
text-align: center;
}

12
src/main/resources/static/js/lay-module/step-lay/step.js

@ -4,21 +4,24 @@
var carousel = layui.carousel;
// 添加步骤条dom节点
var renderDom = function (elem, stepItems, position) {
var renderDom = function (elem, stepItems, position,newnumber) {
var stepDiv = '<div class="lay-step">';
for (var i = 0; i < stepItems.length; i++) {
stepDiv += '<div class="step-item">';
// 线
if (i < (stepItems.length - 1)) {
if (i < position) {
stepDiv += '<div class="step-item-tail"><i class="step-item-tail-done"></i></div>';
stepDiv += '<div class="step-item-tail" style="display:none;"><i class="step-item-tail-done" ></i></div>';
} else {
stepDiv += '<div class="step-item-tail"><i class=""></i></div>';
stepDiv += '<div class="step-item-tail" style="display:none;"><i class=""></i></div>';
}
}
// 数字
var number = stepItems[i].number;
if(newnumber != 0){
number = newnumber;
}
if (!number) {
number = i + 1;
}
@ -60,6 +63,7 @@
param.indicator = 'none'; // 不显示指示器
param.arrow = 'always'; // 始终显示箭头
param.autoplay = false; // 关闭自动播放
if (!param.stepWidth) {
param.stepWidth = '400px';
}
@ -69,7 +73,7 @@
// 渲染步骤条
var stepItems = param.stepItems;
renderDom(param.elem, stepItems, param.position||0);
renderDom(param.elem, stepItems, param.position||0,param.number);
$('.lay-step').css('width', param.stepWidth);
//监听轮播切换事件

8
src/main/resources/templates/index.html

@ -51,6 +51,10 @@
<ul class="layui-nav layui-layout-right">
<li class="layui-nav-item" lay-unselect>
<a href="javascript:;" id="scan"><i class="fa fa-square-o" aria-hidden="true"></i></a>
</li>
<li class="layui-nav-item" lay-unselect>
<a href="javascript:;" data-refresh="刷新"><i class="fa fa-refresh"></i></a>
</li>
@ -151,9 +155,11 @@
};
options.iniUrl= "/index/menus?uid="+uid // 初始化接口
miniAdmin.render(options);
console.log(options)
/*$("#scan").on("click",function () {
alert("扫一扫")
});*/
// 百度统计代码,只统计指定域名

13
src/main/resources/templates/pages/application/application-review.html

@ -156,13 +156,15 @@
var state=$("#state").text();
//当前处于的状态
var position=0,states={};
var position=0,states={},number = 1;
if (state === "待部门负责人审核" || state === "部门负责人审核未通过") {
position = 1;
states = [{title: "提交申请"}, {title: state}, {title: "未入库"}];
// , {title: "未入库"}
states = [ {title: state}];
number = 2;
} else {
position = 2;
states = [{title: "提交申请"}, {title: "审核通过"}, {title: state}];
// {title: "提交申请"},
states = [ {title: state}];
number = 3;
}
step.render({
elem: '#stepForm',
@ -171,6 +173,7 @@
stepWidth: '750px',
height: '650px',
position: position,
number:number,
stepItems: states
});

1
src/main/resources/templates/pages/application/application-transfer.html

@ -203,6 +203,7 @@
$('.next').click(function () {
step.next('#stepForm');
});
// 实现卡片添加

146
src/main/resources/templates/pages/application/my-apply.html

@ -10,28 +10,26 @@
<link rel="stylesheet" href="/static/css/public.css" media="all">
</head>
<body>
<style>
.clearfix:after, .clearfix:before {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
</style>
<div class="layui-bg-gray">
<fieldset class="layui-elem-field layui-field-title" style="padding: 10px;">
<legend>入库记录</legend>
<table class="layui-table">
<colgroup>
<col width="25%">
<col width="25%">
<col width="25%">
<col width="25%">
</colgroup>
<tbody id="LAY_floor_in"></tbody>
</table>
<ul id="LAY_floor_in" class="flow-default" style="width: 100%"></ul>
<legend>出库申请</legend>
<table class="layui-table">
<colgroup>
<col width="25%">
<col width="25%">
<col width="25%">
<col width="25%">
</colgroup>
<tbody id="LAY_floor_out"></tbody>
</table>
<ul id="LAY_floor_out" class="flow-default" style="width: 100%"></ul>
</fieldset>
</div>
@ -39,44 +37,46 @@
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
var data;
//先声明
function openDetailIn(data){};
function openDetailOut(data){};
layui.use(['flow','layer', 'flow','util'], function () {
function openDetailIn(data) {
};
function openDetailOut(data) {
};
layui.use(['flow', 'layer', 'flow', 'util'], function () {
var $ = layui.jquery,
layer=layui.layer,
layer = layui.layer,
flow = layui.flow,
util=layui.util;
let size=8;
let inpre=0;
let outpre=0;
util = layui.util;
let size = 8;
let inpre = 0;
let outpre = 0;
flow.load({
elem: '#LAY_floor_in' //流加载容器
,scrollElem: '#LAY_floor_in' //滚动条所在元素,一般不用填,此处只是演示需要。
,isAuto:false
,done: function(page, next){ //执行下一页的回调
, scrollElem: '#LAY_floor_in' //滚动条所在元素,一般不用填,此处只是演示需要。
, isAuto: false
, done: function (page, next) { //执行下一页的回调
let lis = [];
let result;
$.get('/depositoryRecord/myApply?page='+page+'&size='+size, function(res){
result=res.data;
$.get('/depositoryRecord/myApply?page=' + page + '&size=' + size, function (res) {
result = res.data;
applicationIn = result["applicationIn"];
InCount = result["InCount"];
applicationOut = result["applicationOut"];
var Width = "25%";
if (isMobile()) {
Width = "50%";
}
lis.push("<div class='clearfix'>")
for (let i = 0; i < applicationIn.length; i++) {
if (i%4===0){
lis.push('<tr>');
}
lis.push('<td><div class="layui-card my-shadow my-card flow1" onclick="openDetailIn('
+applicationIn[i].id+')"><div class="layui-card-header"><h2>'
+applicationIn[i].applicantName+'的入库记录')
lis.push('<div class="layui-card-body">'+applicationIn[i].applyRemark
+'</div><div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+applicationIn[i].applicantTime+'</div></div></td>');
if (i%4===3){
lis.push('</tr>');
}
lis.push('<li style="width:' + Width + ';float:left;"><div class="layui-card my-shadow my-card flow1" onclick="openDetailIn('
+ applicationIn[i].id + ')"><div class="layui-card-header"><h2>'
+ applicationIn[i].applicantName + '的入库记录</h2></div>')
lis.push('<div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+ applicationIn[i].applicantTime + '</div></div></li>');
}
inpre+=applicationIn.length;
lis.push('</div>');
inpre += applicationIn.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), inpre < InCount);
@ -85,31 +85,32 @@
});
flow.load({
elem: '#LAY_floor_out' //流加载容器
,scrollElem: '#LAY_floor_out' //滚动条所在元素,一般不用填,此处只是演示需要。
,isAuto:false
,done: function(page, next){ //执行下一页的回调
, scrollElem: '#LAY_floor_out' //滚动条所在元素,一般不用填,此处只是演示需要。
, isAuto: false
, done: function (page, next) { //执行下一页的回调
let lis = [];
let result;
$.get('/depositoryRecord/myApply?page='+page+'&size='+size, function(res){
result=res.data;
applicationIn = result["applicationIn"];
lis.push("<div class='clearfix'>")
$.get('/depositoryRecord/myApply?page=' + page + '&size=' + size, function (res) {
result = res.data;
applicationOut = result["applicationOut"];
OutCount = result["OutCount"];
var Width = "25%";
if (isMobile()) {
Width = "50%";
}
lis.push("<div class='clearfix'>")
for (let i = 0; i < applicationOut.length; i++) {
if (i%4===0){
lis.push('<tr>');
}
lis.push('<td><div class="layui-card my-shadow my-card flow1" onclick="openDetailOut('
+applicationOut[i].id+')"><div class="layui-card-header"><h2>'
+applicationOut[i].applicantName+'的出库请求')
lis.push('<div class="layui-card-body">'+applicationOut[i].applyRemark
+'</div><div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+applicationOut[i].applicantTime+'</div></div></td>');
if (i%4===3){
lis.push('</tr>');
}
lis.push('<li style="width:' + Width + ';float:left;"><div class="layui-card my-shadow my-card flow1" onclick="openDetailOut('
+ applicationOut[i].id + ')"><div class="layui-card-header"><h2>'
+ applicationOut[i].applicantName + '的出库请求</h2></div>')
lis.push('<div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+ applicationOut[i].applicantTime + '</div></div></li>');
}
outpre+=applicationOut.length;
lis.push('</div>');
outpre += applicationOut.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), outpre < OutCount);
@ -124,13 +125,13 @@
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/form_step_look?id='+item,
content: '/form_step_look?id=' + item,
});
$(window).on("resize", function () {
layer.full(index);
});
},
openDetailOut = function (item) {
};
openDetailOut = function (item) {
var index = layer.open({
title: '请求详情',
type: 2,
@ -138,11 +139,20 @@
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/ApplicationOutView?id='+item,
content: '/ApplicationOutView?id=' + item,
});
$(window).on("resize", function () {
layer.full(index);
});
};
//定义一个函数判断是手机端还是pc端
function isMobile() {
if (window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) {
return true; // 移动端
} else {
return false; // PC端
}
}
});
</script>

89
src/main/resources/templates/pages/application/my-task.html

@ -10,36 +10,31 @@
<link rel="stylesheet" href="/static/css/public.css" media="all">
</head>
<style>
.clearfix:after,.clearfix:before{
content: "";
display: table;
}
.clearfix:after{
clear: both;
}
.clearfix{
*zoom: 1;
}
</style>
<div class="layui-bg-gray" style="padding: 10px;">
<fieldset class="layui-elem-field layui-field-title">
<legend>未完成任务</legend>
</fieldset>
<table class="layui-table">
<colgroup>
<col width="25%">
<col width="25%">
<col width="25%">
<col width="25%">
</colgroup>
<tbody id="LAY_floor1">
</tbody>
</table>
<ul id="LAY_floor1" class="flow-default" style="width: 100%"></ul>
</div>
<div class="layui-bg-gray" style="padding: 10px;">
<fieldset class="layui-elem-field layui-field-title">
<legend>已完成任务</legend>
</fieldset>
<table class="layui-table">
<colgroup>
<col width="25%">
<col width="25%">
<col width="25%">
<col width="25%">
</colgroup>
<tbody id="LAY_floor2">
</tbody>
</table>
<ul id="LAY_floor2" class="flow-default" style="width: 100%"></ul>
</div>
@ -56,10 +51,11 @@
//先声明
function openDetail2(data) {
};
layui.use(['flow', 'layer', 'flow', 'util'], function () {
layui.use(['flow', 'layer', 'table', 'util'], function () {
var $ = layui.jquery,
layer = layui.layer,
flow = layui.flow,
table = layui.table,
util = layui.util;
//每页的数量
var size=8;
@ -72,26 +68,21 @@
let lis = [];
let result;
$.get('/depositoryRecord/myTask?page='+page+'&size='+size+'&isDone=0', function(res){
var Width = "25%";
result=res.data;
console.log(res)
lis.push("<div class='clearfix'>")
for (let i=0;i<result.length;i++){
if (i%4===0){
lis.push('<tr>');
if(isMobile()){
Width = "50%";
}
lis.push('<td><div class="layui-card my-shadow my-card flow1" onclick="openDetail1('
lis.push('<li style="width:'+ Width +';float:left;"><div class="layui-card my-shadow my-card flow1" onclick="openDetail1('
+result[i].id+')"><div class="layui-card-header"><h2>'
+result[i].applicantName+'的')
lis.push('出库请求</h2></div>');
lis.push('<div class="layui-card-body">'+result[i].applyRemark
+'</div><div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+result[i].applicantTime+'</div></div></td>');
if (i%4===3){
lis.push('</tr>');
}
}
if (result.length%4!==0){
lis.push('</tr>');
lis.push('<div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+result[i].applicantTime+'</div></div></li>');
}
lis.push('</div>');
pre1+=result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
@ -107,29 +98,25 @@
let lis = [];
let result;
$.get('/depositoryRecord/myTask?page='+page+'&size='+size+'&isDone=1', function(res){
var Width = "25%";
result=res.data;
lis.push("<div class='clearfix'>")
for (let i=0;i<result.length;i++){
if (i%4===0){
lis.push('<tr>');
if(isMobile()){
Width = "50%";
}
lis.push('<td><div class="layui-card my-shadow my-card flow1" onclick="openDetail2('
+result[i].id+')"><div class="layui-card-header"><h2>'
lis.push('<li style="width:'+ Width +';float:left;"><div class="layui-card my-shadow my-card flow1" onclick="openDetail2('
+result[i].id+')" ><div class="layui-card-header"><h2>'
+result[i].applicantName+'的')
if (result[i].type===1){
lis.push('入库请求</h2></div>');
}else {
lis.push('出库请求</h2></div>');
}
lis.push('<div class="layui-card-body">'+result[i].applyRemark
+'</div><div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+result[i].applicantTime+'</div></div></td>');
if (i%4===3){
lis.push('</tr>');
}
}
if (result.length%4!==0){
lis.push('</tr>');
lis.push('<div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+result[i].applicantTime+'</div></div></li>');
}
lis.push("</div>")
pre2+=result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
@ -174,6 +161,14 @@
});
}
//定义一个函数判断是手机端还是pc端
function isMobile(){
if(window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) {
return true; // 移动端
}else{
return false; // PC端
}
}
});
</script>
</html>

32
src/main/resources/templates/pages/application/my-task_back.html

@ -30,15 +30,8 @@
<fieldset class="layui-elem-field layui-field-title">
<legend>已完成任务</legend>
</fieldset>
<table class="layui-table">
<colgroup>
<col width="25%">
<col width="25%">
<col width="25%">
<col width="25%">
</colgroup>
<tbody id="LAY_floor2">
</tbody>
</table>
@ -58,10 +51,11 @@
//先声明
function openDetail2(data) {
};
layui.use(['flow', 'layer', 'flow', 'util'], function () {
layui.use(['flow', 'layer', 'table', 'util'], function () {
var $ = layui.jquery,
layer = layui.layer,
flow = layui.flow,
table = layui.table,
util = layui.util;
//每页的数量
var size=8;
@ -77,19 +71,15 @@
result=res.data;
for (let i=0;i<result.length;i++){
if (i%4===0){
lis.push('<tr>');
lis.push('<tr >');
}
lis.push('<td><div class="layui-card my-shadow my-card flow1" onclick="openDetail1('
lis.push('<td ><div class="layui-card my-shadow my-card flow1" onclick="openDetail1('
+result[i].id+')"><div class="layui-card-header"><h2>'
+result[i].applicantName+'的')
if (result[i].type===1){
lis.push('入库请求</h2></div>');
}else {
lis.push('出库请求</h2></div>');
}
lis.push('出库请求</h2></div>');
lis.push('<div class="layui-card-body">'+result[i].applyRemark
+'</div><div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+result[i].applyTime+'</div></div></td>');
+result[i].applicantTime+'</div></div></td>');
if (i%4===3){
lis.push('</tr>');
}
@ -115,10 +105,10 @@
result=res.data;
for (let i=0;i<result.length;i++){
if (i%4===0){
lis.push('<tr>');
lis.push('<tr >');
}
lis.push('<td><div class="layui-card my-shadow my-card flow1" onclick="openDetail2('
+result[i].id+')"><div class="layui-card-header"><h2>'
+result[i].id+')" ><div class="layui-card-header"><h2>'
+result[i].applicantName+'的')
if (result[i].type===1){
lis.push('入库请求</h2></div>');
@ -127,7 +117,7 @@
}
lis.push('<div class="layui-card-body">'+result[i].applyRemark
+'</div><div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+result[i].applyTime+'</div></div></td>');
+result[i].applicantTime+'</div></div></td>');
if (i%4===3){
lis.push('</tr>');
}
@ -169,7 +159,7 @@
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/form_step_look?id='+item,
content: '/ApplicationOutView?id='+item,
end:function () {
location.reload()
}

4
target/classes/application-test.yml

@ -80,6 +80,10 @@ spring:
min-idle: 0
timeout: 2000ms
# resources:
# static-locations: classpath:/static/
server:

8
target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml

@ -18,6 +18,7 @@
<result column="amounts" property="amounts" jdbcType="DOUBLE"/>
<result column="unit" property="unit" jdbcType="VARCHAR"/>
<result column="texture" property="texture" jdbcType="VARCHAR"/>
<result column="number_of_temporary" property="numberOfTemporary" jdbcType="VARCHAR"/>
</resultMap>
<!-- 字段映射-->
@ -50,7 +51,7 @@
<!-- 表查询字段 -->
<sql id="allColumns">
m.id, m.depository_id, m.mname, m.quantity, m.price, m.type_id,m.state,m.code ,m.version ,m.amounts ,m.unit ,m.texture,m.depositoryCode
m.id, m.depository_id, m.mname, m.quantity, m.price, m.type_id,m.state,m.code ,m.version ,m.amounts ,m.unit ,m.texture,m.depositoryCode,m.number_of_temporary
</sql>
<!-- 表查询字段,包括材料类型 -->
@ -244,7 +245,10 @@
unit = #{unit},
</if>
<if test="depositoryCode != null and depositoryCode !=''">
depositoryCode = #{depositoryCode}
depositoryCode = #{depositoryCode},
</if>
<if test="numberOfTemporary != null and numberOfTemporary != ''">
number_of_temporary = #{numberOfTemporary}
</if>
</set>
WHERE id = #{id}

2
target/classes/static/css/public.css

@ -82,7 +82,7 @@ body {
}
.my-time{
margin-top: 20px;
margin-top: 40px;
margin-bottom: 20px;
}
body{

BIN
target/classes/static/images/search.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

6
target/classes/static/js/lay-module/step-lay/step.css

@ -3,6 +3,7 @@
width: 400px;
margin: 0 auto;
max-width: 100%;
text-align: center;
}
.step-item {
@ -54,8 +55,9 @@
.step-item-main {
display: block;
position: relative;
margin-left: -50%;
margin-right: 50%;
/*margin-left: -20px;*/
/*margin-left: -50%;*/
/*margin-right: 50%;*/
padding-left: 26px;
text-align: center;
}

12
target/classes/static/js/lay-module/step-lay/step.js

@ -4,21 +4,24 @@
var carousel = layui.carousel;
// 添加步骤条dom节点
var renderDom = function (elem, stepItems, position) {
var renderDom = function (elem, stepItems, position,newnumber) {
var stepDiv = '<div class="lay-step">';
for (var i = 0; i < stepItems.length; i++) {
stepDiv += '<div class="step-item">';
// 线
if (i < (stepItems.length - 1)) {
if (i < position) {
stepDiv += '<div class="step-item-tail"><i class="step-item-tail-done"></i></div>';
stepDiv += '<div class="step-item-tail" style="display:none;"><i class="step-item-tail-done" ></i></div>';
} else {
stepDiv += '<div class="step-item-tail"><i class=""></i></div>';
stepDiv += '<div class="step-item-tail" style="display:none;"><i class=""></i></div>';
}
}
// 数字
var number = stepItems[i].number;
if(newnumber != 0){
number = newnumber;
}
if (!number) {
number = i + 1;
}
@ -60,6 +63,7 @@
param.indicator = 'none'; // 不显示指示器
param.arrow = 'always'; // 始终显示箭头
param.autoplay = false; // 关闭自动播放
if (!param.stepWidth) {
param.stepWidth = '400px';
}
@ -69,7 +73,7 @@
// 渲染步骤条
var stepItems = param.stepItems;
renderDom(param.elem, stepItems, param.position||0);
renderDom(param.elem, stepItems, param.position||0,param.number);
$('.lay-step').css('width', param.stepWidth);
//监听轮播切换事件

8
target/classes/templates/index.html

@ -51,6 +51,10 @@
<ul class="layui-nav layui-layout-right">
<li class="layui-nav-item" lay-unselect>
<a href="javascript:;" id="scan"><i class="fa fa-square-o" aria-hidden="true"></i></a>
</li>
<li class="layui-nav-item" lay-unselect>
<a href="javascript:;" data-refresh="刷新"><i class="fa fa-refresh"></i></a>
</li>
@ -151,9 +155,11 @@
};
options.iniUrl= "/index/menus?uid="+uid // 初始化接口
miniAdmin.render(options);
console.log(options)
/*$("#scan").on("click",function () {
alert("扫一扫")
});*/
// 百度统计代码,只统计指定域名

13
target/classes/templates/pages/application/application-review.html

@ -156,13 +156,15 @@
var state=$("#state").text();
//当前处于的状态
var position=0,states={};
var position=0,states={},number = 1;
if (state === "待部门负责人审核" || state === "部门负责人审核未通过") {
position = 1;
states = [{title: "提交申请"}, {title: state}, {title: "未入库"}];
// , {title: "未入库"}
states = [ {title: state}];
number = 2;
} else {
position = 2;
states = [{title: "提交申请"}, {title: "审核通过"}, {title: state}];
// {title: "提交申请"},
states = [ {title: state}];
number = 3;
}
step.render({
elem: '#stepForm',
@ -171,6 +173,7 @@
stepWidth: '750px',
height: '650px',
position: position,
number:number,
stepItems: states
});

1
target/classes/templates/pages/application/application-transfer.html

@ -203,6 +203,7 @@
$('.next').click(function () {
step.next('#stepForm');
});
// 实现卡片添加

146
target/classes/templates/pages/application/my-apply.html

@ -10,28 +10,26 @@
<link rel="stylesheet" href="/static/css/public.css" media="all">
</head>
<body>
<style>
.clearfix:after, .clearfix:before {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
</style>
<div class="layui-bg-gray">
<fieldset class="layui-elem-field layui-field-title" style="padding: 10px;">
<legend>入库记录</legend>
<table class="layui-table">
<colgroup>
<col width="25%">
<col width="25%">
<col width="25%">
<col width="25%">
</colgroup>
<tbody id="LAY_floor_in"></tbody>
</table>
<ul id="LAY_floor_in" class="flow-default" style="width: 100%"></ul>
<legend>出库申请</legend>
<table class="layui-table">
<colgroup>
<col width="25%">
<col width="25%">
<col width="25%">
<col width="25%">
</colgroup>
<tbody id="LAY_floor_out"></tbody>
</table>
<ul id="LAY_floor_out" class="flow-default" style="width: 100%"></ul>
</fieldset>
</div>
@ -39,44 +37,46 @@
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
var data;
//先声明
function openDetailIn(data){};
function openDetailOut(data){};
layui.use(['flow','layer', 'flow','util'], function () {
function openDetailIn(data) {
};
function openDetailOut(data) {
};
layui.use(['flow', 'layer', 'flow', 'util'], function () {
var $ = layui.jquery,
layer=layui.layer,
layer = layui.layer,
flow = layui.flow,
util=layui.util;
let size=8;
let inpre=0;
let outpre=0;
util = layui.util;
let size = 8;
let inpre = 0;
let outpre = 0;
flow.load({
elem: '#LAY_floor_in' //流加载容器
,scrollElem: '#LAY_floor_in' //滚动条所在元素,一般不用填,此处只是演示需要。
,isAuto:false
,done: function(page, next){ //执行下一页的回调
, scrollElem: '#LAY_floor_in' //滚动条所在元素,一般不用填,此处只是演示需要。
, isAuto: false
, done: function (page, next) { //执行下一页的回调
let lis = [];
let result;
$.get('/depositoryRecord/myApply?page='+page+'&size='+size, function(res){
result=res.data;
$.get('/depositoryRecord/myApply?page=' + page + '&size=' + size, function (res) {
result = res.data;
applicationIn = result["applicationIn"];
InCount = result["InCount"];
applicationOut = result["applicationOut"];
var Width = "25%";
if (isMobile()) {
Width = "50%";
}
lis.push("<div class='clearfix'>")
for (let i = 0; i < applicationIn.length; i++) {
if (i%4===0){
lis.push('<tr>');
}
lis.push('<td><div class="layui-card my-shadow my-card flow1" onclick="openDetailIn('
+applicationIn[i].id+')"><div class="layui-card-header"><h2>'
+applicationIn[i].applicantName+'的入库记录')
lis.push('<div class="layui-card-body">'+applicationIn[i].applyRemark
+'</div><div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+applicationIn[i].applicantTime+'</div></div></td>');
if (i%4===3){
lis.push('</tr>');
}
lis.push('<li style="width:' + Width + ';float:left;"><div class="layui-card my-shadow my-card flow1" onclick="openDetailIn('
+ applicationIn[i].id + ')"><div class="layui-card-header"><h2>'
+ applicationIn[i].applicantName + '的入库记录</h2></div>')
lis.push('<div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+ applicationIn[i].applicantTime + '</div></div></li>');
}
inpre+=applicationIn.length;
lis.push('</div>');
inpre += applicationIn.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), inpre < InCount);
@ -85,31 +85,32 @@
});
flow.load({
elem: '#LAY_floor_out' //流加载容器
,scrollElem: '#LAY_floor_out' //滚动条所在元素,一般不用填,此处只是演示需要。
,isAuto:false
,done: function(page, next){ //执行下一页的回调
, scrollElem: '#LAY_floor_out' //滚动条所在元素,一般不用填,此处只是演示需要。
, isAuto: false
, done: function (page, next) { //执行下一页的回调
let lis = [];
let result;
$.get('/depositoryRecord/myApply?page='+page+'&size='+size, function(res){
result=res.data;
applicationIn = result["applicationIn"];
lis.push("<div class='clearfix'>")
$.get('/depositoryRecord/myApply?page=' + page + '&size=' + size, function (res) {
result = res.data;
applicationOut = result["applicationOut"];
OutCount = result["OutCount"];
var Width = "25%";
if (isMobile()) {
Width = "50%";
}
lis.push("<div class='clearfix'>")
for (let i = 0; i < applicationOut.length; i++) {
if (i%4===0){
lis.push('<tr>');
}
lis.push('<td><div class="layui-card my-shadow my-card flow1" onclick="openDetailOut('
+applicationOut[i].id+')"><div class="layui-card-header"><h2>'
+applicationOut[i].applicantName+'的出库请求')
lis.push('<div class="layui-card-body">'+applicationOut[i].applyRemark
+'</div><div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+applicationOut[i].applicantTime+'</div></div></td>');
if (i%4===3){
lis.push('</tr>');
}
lis.push('<li style="width:' + Width + ';float:left;"><div class="layui-card my-shadow my-card flow1" onclick="openDetailOut('
+ applicationOut[i].id + ')"><div class="layui-card-header"><h2>'
+ applicationOut[i].applicantName + '的出库请求</h2></div>')
lis.push('<div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+ applicationOut[i].applicantTime + '</div></div></li>');
}
outpre+=applicationOut.length;
lis.push('</div>');
outpre += applicationOut.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), outpre < OutCount);
@ -124,13 +125,13 @@
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/form_step_look?id='+item,
content: '/form_step_look?id=' + item,
});
$(window).on("resize", function () {
layer.full(index);
});
},
openDetailOut = function (item) {
};
openDetailOut = function (item) {
var index = layer.open({
title: '请求详情',
type: 2,
@ -138,11 +139,20 @@
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/ApplicationOutView?id='+item,
content: '/ApplicationOutView?id=' + item,
});
$(window).on("resize", function () {
layer.full(index);
});
};
//定义一个函数判断是手机端还是pc端
function isMobile() {
if (window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) {
return true; // 移动端
} else {
return false; // PC端
}
}
});
</script>

89
target/classes/templates/pages/application/my-task.html

@ -10,36 +10,31 @@
<link rel="stylesheet" href="/static/css/public.css" media="all">
</head>
<style>
.clearfix:after,.clearfix:before{
content: "";
display: table;
}
.clearfix:after{
clear: both;
}
.clearfix{
*zoom: 1;
}
</style>
<div class="layui-bg-gray" style="padding: 10px;">
<fieldset class="layui-elem-field layui-field-title">
<legend>未完成任务</legend>
</fieldset>
<table class="layui-table">
<colgroup>
<col width="25%">
<col width="25%">
<col width="25%">
<col width="25%">
</colgroup>
<tbody id="LAY_floor1">
</tbody>
</table>
<ul id="LAY_floor1" class="flow-default" style="width: 100%"></ul>
</div>
<div class="layui-bg-gray" style="padding: 10px;">
<fieldset class="layui-elem-field layui-field-title">
<legend>已完成任务</legend>
</fieldset>
<table class="layui-table">
<colgroup>
<col width="25%">
<col width="25%">
<col width="25%">
<col width="25%">
</colgroup>
<tbody id="LAY_floor2">
</tbody>
</table>
<ul id="LAY_floor2" class="flow-default" style="width: 100%"></ul>
</div>
@ -56,10 +51,11 @@
//先声明
function openDetail2(data) {
};
layui.use(['flow', 'layer', 'flow', 'util'], function () {
layui.use(['flow', 'layer', 'table', 'util'], function () {
var $ = layui.jquery,
layer = layui.layer,
flow = layui.flow,
table = layui.table,
util = layui.util;
//每页的数量
var size=8;
@ -72,26 +68,21 @@
let lis = [];
let result;
$.get('/depositoryRecord/myTask?page='+page+'&size='+size+'&isDone=0', function(res){
var Width = "25%";
result=res.data;
console.log(res)
lis.push("<div class='clearfix'>")
for (let i=0;i<result.length;i++){
if (i%4===0){
lis.push('<tr>');
if(isMobile()){
Width = "50%";
}
lis.push('<td><div class="layui-card my-shadow my-card flow1" onclick="openDetail1('
lis.push('<li style="width:'+ Width +';float:left;"><div class="layui-card my-shadow my-card flow1" onclick="openDetail1('
+result[i].id+')"><div class="layui-card-header"><h2>'
+result[i].applicantName+'的')
lis.push('出库请求</h2></div>');
lis.push('<div class="layui-card-body">'+result[i].applyRemark
+'</div><div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+result[i].applicantTime+'</div></div></td>');
if (i%4===3){
lis.push('</tr>');
}
}
if (result.length%4!==0){
lis.push('</tr>');
lis.push('<div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+result[i].applicantTime+'</div></div></li>');
}
lis.push('</div>');
pre1+=result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
@ -107,29 +98,25 @@
let lis = [];
let result;
$.get('/depositoryRecord/myTask?page='+page+'&size='+size+'&isDone=1', function(res){
var Width = "25%";
result=res.data;
lis.push("<div class='clearfix'>")
for (let i=0;i<result.length;i++){
if (i%4===0){
lis.push('<tr>');
if(isMobile()){
Width = "50%";
}
lis.push('<td><div class="layui-card my-shadow my-card flow1" onclick="openDetail2('
+result[i].id+')"><div class="layui-card-header"><h2>'
lis.push('<li style="width:'+ Width +';float:left;"><div class="layui-card my-shadow my-card flow1" onclick="openDetail2('
+result[i].id+')" ><div class="layui-card-header"><h2>'
+result[i].applicantName+'的')
if (result[i].type===1){
lis.push('入库请求</h2></div>');
}else {
lis.push('出库请求</h2></div>');
}
lis.push('<div class="layui-card-body">'+result[i].applyRemark
+'</div><div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+result[i].applicantTime+'</div></div></td>');
if (i%4===3){
lis.push('</tr>');
}
}
if (result.length%4!==0){
lis.push('</tr>');
lis.push('<div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+result[i].applicantTime+'</div></div></li>');
}
lis.push("</div>")
pre2+=result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
@ -174,6 +161,14 @@
});
}
//定义一个函数判断是手机端还是pc端
function isMobile(){
if(window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) {
return true; // 移动端
}else{
return false; // PC端
}
}
});
</script>
</html>

32
target/classes/templates/pages/application/my-task_back.html

@ -30,15 +30,8 @@
<fieldset class="layui-elem-field layui-field-title">
<legend>已完成任务</legend>
</fieldset>
<table class="layui-table">
<colgroup>
<col width="25%">
<col width="25%">
<col width="25%">
<col width="25%">
</colgroup>
<tbody id="LAY_floor2">
</tbody>
</table>
@ -58,10 +51,11 @@
//先声明
function openDetail2(data) {
};
layui.use(['flow', 'layer', 'flow', 'util'], function () {
layui.use(['flow', 'layer', 'table', 'util'], function () {
var $ = layui.jquery,
layer = layui.layer,
flow = layui.flow,
table = layui.table,
util = layui.util;
//每页的数量
var size=8;
@ -77,19 +71,15 @@
result=res.data;
for (let i=0;i<result.length;i++){
if (i%4===0){
lis.push('<tr>');
lis.push('<tr >');
}
lis.push('<td><div class="layui-card my-shadow my-card flow1" onclick="openDetail1('
lis.push('<td ><div class="layui-card my-shadow my-card flow1" onclick="openDetail1('
+result[i].id+')"><div class="layui-card-header"><h2>'
+result[i].applicantName+'的')
if (result[i].type===1){
lis.push('入库请求</h2></div>');
}else {
lis.push('出库请求</h2></div>');
}
lis.push('出库请求</h2></div>');
lis.push('<div class="layui-card-body">'+result[i].applyRemark
+'</div><div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+result[i].applyTime+'</div></div></td>');
+result[i].applicantTime+'</div></div></td>');
if (i%4===3){
lis.push('</tr>');
}
@ -115,10 +105,10 @@
result=res.data;
for (let i=0;i<result.length;i++){
if (i%4===0){
lis.push('<tr>');
lis.push('<tr >');
}
lis.push('<td><div class="layui-card my-shadow my-card flow1" onclick="openDetail2('
+result[i].id+')"><div class="layui-card-header"><h2>'
+result[i].id+')" ><div class="layui-card-header"><h2>'
+result[i].applicantName+'的')
if (result[i].type===1){
lis.push('入库请求</h2></div>');
@ -127,7 +117,7 @@
}
lis.push('<div class="layui-card-body">'+result[i].applyRemark
+'</div><div class="layui-col-md4 my-time" style="margin-left: 15px; color: #999;font-size: 12px;">'
+result[i].applyTime+'</div></div></td>');
+result[i].applicantTime+'</div></div></td>');
if (i%4===3){
lis.push('</tr>');
}
@ -169,7 +159,7 @@
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/form_step_look?id='+item,
content: '/ApplicationOutView?id='+item,
end:function () {
location.reload()
}

Loading…
Cancel
Save