Commit aa821799 by zhanglt

品名代码保存接口bug

台账明细导出bug
盘亏删除bug
parent 7e783147
...@@ -230,8 +230,8 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> { ...@@ -230,8 +230,8 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
List<ExcelExportInfo> excelExportInfoList = new ArrayList<>(); List<ExcelExportInfo> excelExportInfoList = new ArrayList<>();
for (StorageInfo si : storageInfoList) { for (StorageInfo si : storageInfoList) {
ExcelExportInfo eei = new ExcelExportInfo(); ExcelExportInfo eei = new ExcelExportInfo();
eei.setMonth(DateUtil.getMonth(si.getCreateDate()) + ""); eei.setMonth(DateUtil.getMonth(si.getStorage().getTime()) + "");
eei.setDay(DateUtil.getDay(si.getCreateDate()) + ""); eei.setDay(DateUtil.getDay(si.getStorage().getTime()) + "");
eei.setBatch(si.getStorage().getBatchNum()); eei.setBatch(si.getStorage().getBatchNum());
eei.setRemarks(si.getRemarks()); eei.setRemarks(si.getRemarks());
eei.setTaskOrSend(0); eei.setTaskOrSend(0);
...@@ -251,8 +251,8 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> { ...@@ -251,8 +251,8 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
} }
for (ProfitWarehousingInfo si : profitWarehousingInfoList) { for (ProfitWarehousingInfo si : profitWarehousingInfoList) {
ExcelExportInfo eei = new ExcelExportInfo(); ExcelExportInfo eei = new ExcelExportInfo();
eei.setMonth(DateUtil.getMonth(si.getCreateDate()) + ""); eei.setMonth(DateUtil.getMonth(si.getProfitWarehousing().getTime()) + "");
eei.setDay(DateUtil.getDay(si.getCreateDate()) + ""); eei.setDay(DateUtil.getDay(si.getProfitWarehousing().getTime()) + "");
eei.setBatch(si.getProfitWarehousing().getNumber()+"[盘盈]"); eei.setBatch(si.getProfitWarehousing().getNumber()+"[盘盈]");
eei.setRemarks(si.getRemarks()); eei.setRemarks(si.getRemarks());
eei.setTaskOrSend(0); eei.setTaskOrSend(0);
...@@ -272,8 +272,8 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> { ...@@ -272,8 +272,8 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
} }
for (OutboundInfo oi : outboundInfoList) { for (OutboundInfo oi : outboundInfoList) {
ExcelExportInfo eei = new ExcelExportInfo(); ExcelExportInfo eei = new ExcelExportInfo();
eei.setMonth(DateUtil.getMonth(oi.getCreateDate()) + ""); eei.setMonth(DateUtil.getMonth(oi.getOutbound().getOutboundTime()) + "");
eei.setDay(DateUtil.getDay(oi.getCreateDate()) + ""); eei.setDay(DateUtil.getDay(oi.getOutbound().getOutboundTime()) + "");
eei.setBatch(oi.getLedgerInfo().getBatchNum()); eei.setBatch(oi.getLedgerInfo().getBatchNum());
eei.setRemarks(oi.getRemarks()); eei.setRemarks(oi.getRemarks());
eei.setTaskOrSend(1); eei.setTaskOrSend(1);
......
...@@ -176,8 +176,43 @@ public class MaterialLossService extends CrudService<MaterialLossMapper, Materia ...@@ -176,8 +176,43 @@ public class MaterialLossService extends CrudService<MaterialLossMapper, Materia
@Transactional(readOnly = false) @Transactional(readOnly = false)
public void delete(MaterialLoss materialLoss) { public void delete(MaterialLoss materialLoss) {
Outbound outbound = new Outbound();
//设置相关表单id为物资盘亏主表的ID
outbound.setRelationId(materialLoss.getId());
List<Outbound> list = outboundService.findList(outbound);
if(list != null && list.size()>0){
outbound.setId(list.get(0).getId());
outboundService.deleteInfo(outbound);
outboundService.delete(outbound);
}
if(materialLoss.getMaterialLossInfoList()!=null && materialLoss.getMaterialLossInfoList().size()>0){
for (MaterialLossInfo materialLossInfo:materialLoss.getMaterialLossInfoList()) {
materialLossInfoMapper.delete(materialLossInfo);
String ledgerInfoId = materialLossInfo.getLedgerInfo().getId();
LedgerInfo ledgerInfo = ledgerInfoMapper.get(ledgerInfoId);
// ledgerInfoMapper.updateByLedgerInfo(ledgerInfoId);
ledgerInfo.setNum(ledgerInfo.getNum() + 1);
ledgerInfoMapper.updateNum(ledgerInfo);
if(ledgerInfo.getQr() != null){
QrCode qrCode = qrCodeService.get(ledgerInfo.getQr().getId());
if(qrCode!=null){
qrCode.setState("2");
qrCodeService.save(qrCode);
}
}
Ledger ledger = ledgerService.get(ledgerInfo.getLedger().getId());
if(ledger != null){
ledger.setNum(ledger.getNum() + 1);
try {
ledger.setSum(ledger.getSum().add(ledgerInfo.getAmount()));
}catch (Exception e){
System.out.println(e.getMessage());
}
ledgerService.lowerLedger(ledger);
}
}
}
super.delete(materialLoss); super.delete(materialLoss);
materialLossInfoMapper.delete(new MaterialLossInfo(materialLoss));
} }
@Transactional(readOnly = false) @Transactional(readOnly = false)
public String createPKDH() { public String createPKDH() {
......
...@@ -37,7 +37,7 @@ public class MaterialTypeService extends TreeService<MaterialTypeMapper, Materia ...@@ -37,7 +37,7 @@ public class MaterialTypeService extends TreeService<MaterialTypeMapper, Materia
public void save(MaterialType materialType) { public void save(MaterialType materialType) {
if (null != materialType.getParentIds()) { if (null != materialType.getParentIds()) {
String [] parentIdsArr = materialType.getParentIds().split(","); String [] parentIdsArr = materialType.getParentIds().split(",");
if (parentIdsArr.length >= 2) { if (parentIdsArr.length > 2) {
materialType.setLast(1); materialType.setLast(1);
} else { } else {
materialType.setLast(0); materialType.setLast(0);
...@@ -49,7 +49,7 @@ public class MaterialTypeService extends TreeService<MaterialTypeMapper, Materia ...@@ -49,7 +49,7 @@ public class MaterialTypeService extends TreeService<MaterialTypeMapper, Materia
@Transactional(readOnly = false) @Transactional(readOnly = false)
public void insert(MaterialType materialType) { public void insert(MaterialType materialType) {
String [] parentIdsArr = materialType.getParentIds().split(","); String [] parentIdsArr = materialType.getParentIds().split(",");
if (parentIdsArr.length >= 2) { if (parentIdsArr.length > 2) {
materialType.setLast(1); materialType.setLast(1);
} else { } else {
materialType.setLast(0); materialType.setLast(0);
......
...@@ -121,7 +121,7 @@ public class MaterialTypeController extends BaseController { ...@@ -121,7 +121,7 @@ public class MaterialTypeController extends BaseController {
materialTypeService.save(materialType);//保存 materialTypeService.save(materialType);//保存
j.setSuccess(true); j.setSuccess(true);
j.put("parentIds", materialType.getParentIds()); j.put("parentIds", materialType.getParentIds());
j.setMsg("保存物资类型成功"); j.setMsg("保存品名代码成功");
return j; return j;
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<sql id="outboundInfoColumns"> <sql id="outboundInfoColumns">
a.id AS "id", a.id AS "id",
a.outbound_id AS "outbound.id", a.outbound_id AS "outbound.id",
outbound.outbound_time AS "outbound.outboundTime",
a.ledger_info_id AS "ledgerInfo.id", a.ledger_info_id AS "ledgerInfo.id",
ledgerInfo.code AS "ledgerInfo.code", ledgerInfo.code AS "ledgerInfo.code",
ledgerInfo.batch_num AS "ledgerInfo.batchNum", ledgerInfo.batch_num AS "ledgerInfo.batchNum",
...@@ -34,6 +35,7 @@ ...@@ -34,6 +35,7 @@
</sql> </sql>
<sql id="outboundInfoJoins"> <sql id="outboundInfoJoins">
left join t_wh_outbound outbound on a.outbound_id = outbound.id
left join t_wh_ledger_info ledgerInfo on a.ledger_info_id = ledgerInfo.id left join t_wh_ledger_info ledgerInfo on a.ledger_info_id = ledgerInfo.id
LEFT JOIN t_wh_material_type tpye ON ledgerInfo.type_id = tpye.id LEFT JOIN t_wh_material_type tpye ON ledgerInfo.type_id = tpye.id
</sql> </sql>
...@@ -69,7 +71,7 @@ ...@@ -69,7 +71,7 @@
AND tpye.id = #{ledgerInfo.type.id} AND tpye.id = #{ledgerInfo.type.id}
</if> </if>
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
AND a.create_date &gt;= #{beginTime} AND a.create_date &lt;= #{endTime} AND outbound.outbound_time &gt;= #{beginTime} AND outbound.outbound_time &lt;= #{endTime}
</if> </if>
</where> </where>
<choose> <choose>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
a.id AS "id", a.id AS "id",
a.profit_warehousing_id AS "profitWarehousing.id", a.profit_warehousing_id AS "profitWarehousing.id",
profitWarehousing.number AS "profitWarehousing.number", profitWarehousing.number AS "profitWarehousing.number",
profitWarehousing.time AS "profitWarehousing.time",
a.name AS "name", a.name AS "name",
a.type AS "type.id", a.type AS "type.id",
type.name AS "type.name", type.name AS "type.name",
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<sql id="storageInfoColumns"> <sql id="storageInfoColumns">
a.id AS "id", a.id AS "id",
a.storage_id AS "storage.id", a.storage_id AS "storage.id",
s.time AS "storage.time",
a.name AS "name", a.name AS "name",
a.type_id AS "type.id", a.type_id AS "type.id",
a.model AS "model", a.model AS "model",
...@@ -86,7 +87,7 @@ ...@@ -86,7 +87,7 @@
<if test="dbName == 'mysql'">concat('%',#{model},'%')</if> <if test="dbName == 'mysql'">concat('%',#{model},'%')</if>
</if> </if>
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
AND a.create_date &gt;= #{beginTime} AND a.create_date &lt;= #{endTime} AND qr.state &lt;&gt; '1' AND s.time >= #{beginTime} AND s.time &lt;= #{endTime} AND qr.state &lt;&gt; '1'
</if> </if>
</where> </where>
<choose> <choose>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment