Commit d074471d authored by 季圣华's avatar 季圣华
Browse files

优化商品信息的字段

parent 3f83d340
......@@ -570,21 +570,13 @@ CREATE TABLE `jsh_material` (
`CategoryId` bigint(20) DEFAULT NULL COMMENT '产品类型',
`Name` varchar(50) DEFAULT NULL COMMENT '名称',
`Mfrs` varchar(50) DEFAULT NULL COMMENT '制造商',
`Packing` decimal(24,6) DEFAULT NULL COMMENT '包装(KG/包)',
`SafetyStock` decimal(24,6) DEFAULT NULL COMMENT '安全存量(KG)',
`Model` varchar(50) DEFAULT NULL COMMENT '型号',
`Standard` varchar(50) DEFAULT NULL COMMENT '规格',
`Color` varchar(50) DEFAULT NULL COMMENT '颜色',
`Unit` varchar(50) DEFAULT NULL COMMENT '单位-单个',
`Remark` varchar(100) DEFAULT NULL COMMENT '备注',
`RetailPrice` decimal(24,6) DEFAULT NULL COMMENT '零售价',
`LowPrice` decimal(24,6) DEFAULT NULL COMMENT '最低售价',
`PresetPriceOne` decimal(24,6) DEFAULT NULL COMMENT '预设售价一',
`PresetPriceTwo` decimal(24,6) DEFAULT NULL COMMENT '预设售价二',
`UnitId` bigint(20) DEFAULT NULL COMMENT '计量单位Id',
`FirstOutUnit` varchar(50) DEFAULT NULL COMMENT '首选出库单位',
`FirstInUnit` varchar(50) DEFAULT NULL COMMENT '首选入库单位',
`PriceStrategy` varchar(500) DEFAULT NULL COMMENT '价格策略',
`Enabled` bit(1) DEFAULT NULL COMMENT '启用 0-禁用 1-启用',
`OtherField1` varchar(50) DEFAULT NULL COMMENT '自定义1',
`OtherField2` varchar(50) DEFAULT NULL COMMENT '自定义2',
......@@ -600,30 +592,30 @@ CREATE TABLE `jsh_material` (
-- ----------------------------
-- Records of jsh_material
-- ----------------------------
INSERT INTO `jsh_material` VALUES ('564', '14', '商品1', '', null, null, 'sp1', '', '', '个', '', '22.000000', '22.000000', '22.000000', '22.000000', null, null, null, '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"enableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '0', '1', '0');
INSERT INTO `jsh_material` VALUES ('565', '14', '商品2', '', null, null, 'sp2', '', '', '个', '', '44.000000', '44.000000', '44.000000', '44.000000', null, null, null, '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"EnableSerialNumber\":\"1\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '1', '1', '0');
INSERT INTO `jsh_material` VALUES ('566', '15', '商品666', '', null, null, 'sp666', '', '', '个', '', '5.000000', '4.000000', '3.000000', '2.000000', null, null, null, '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '0', '117', '0');
INSERT INTO `jsh_material` VALUES ('567', null, '商品1', '', null, null, 'dsp1', '', '', '个', '', '11.000000', '11.000000', '11.000000', '11.000000', null, null, null, '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '0', '115', '0');
INSERT INTO `jsh_material` VALUES ('568', '17', '商品1', '', null, '100.000000', 'sp1', '', '', '个', '', null, null, null, null, null, null, null, '[{\"basic\":{\"Unit\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\"}}]', '', '', '', '', '0', '63', '0');
INSERT INTO `jsh_material` VALUES ('569', '17', '商品2', '', null, '200.000000', 'sp2', '', '', '只', '', '5.000000', '5.000000', '5.000000', '5.000000', null, null, null, '[{\"basic\":{\"Unit\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\"}}]', '', '', '', '', '0', '63', '0');
INSERT INTO `jsh_material` VALUES ('570', '17', '商品3', '', null, '300.000000', 'sp3', '', '', '个', '', null, null, null, null, null, null, null, '[{\"basic\":{\"Unit\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\"}}]', '', '', '', '', '0', '63', '0');
INSERT INTO `jsh_material` VALUES ('571', null, '商品4', '', null, null, 'sp4', '', '', '', '', null, null, null, null, '15', '个', '箱', '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"3\",\"LowPrice\":\"2\",\"PresetPriceOne\":\"2\",\"PresetPriceTwo\":\"2\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"36\",\"LowPrice\":\"24\",\"PresetPriceOne\":\"24\",\"PresetPriceTwo\":\"24\"}}]', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('572', null, '234234', '', null, null, '234234', '', '', '', '', null, null, null, null, null, null, null, '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('573', null, '12312', '', null, null, '12', '', '', '', '', null, null, null, null, null, null, null, '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('574', null, '商品5', '', null, null, '213qw', '', '', '个', '', null, null, null, null, null, null, null, '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('575', null, '商品6', '', null, null, 'sp6', '', '', '', '', null, null, null, null, '15', '', '', '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('576', null, '商品7', '', null, null, 'sp7', '', '', '', '', null, null, null, null, '15', '', '', '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('577', null, '商品8', '', null, null, 'sp8', '', '', '', '', null, null, null, null, '15', '', '', '[{\"basic\":{\"Unit\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\"}}]', '', '', '', '', '0', '63', '0');
INSERT INTO `jsh_material` VALUES ('578', '17', '商品9', '', null, null, 'sp9', '', '', '', '', null, null, null, null, '15', '', '', '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('579', null, '商品17', '', null, null, 'sp17', '', '', '', '', null, null, null, null, '15', '', '', '[{\"basic\":{\"Unit\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\"}}]', '', '', '', '', '0', '63', '0');
INSERT INTO `jsh_material` VALUES ('580', null, '15', '', null, null, '15', '', '', '', '', null, null, null, null, '15', '', '', '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('581', null, '16', '', null, null, '16', '', '', '', '', null, null, null, null, '15', '', '', '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('582', null, '商品20', '', null, null, 'sp2', '', '', '个', '', null, null, null, null, null, '', '', '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('583', null, 'wer', '', null, null, 'rqwe', '', '', '', '', null, null, null, null, '15', '', '', '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('584', null, 'sfds', '', null, null, 'a2233', '12', '2', 'ge', '', '1.000000', '2.000000', '3.000000', '4.000000', null, '', '', '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('585', null, 'asdf', '', null, null, 'adsfasdf', '', '', '', '', null, null, null, null, '15', '', '', '[{\"basic\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\",\"RetailPrice\":\"\",\"LowPrice\":\"\",\"PresetPriceOne\":\"\",\"PresetPriceTwo\":\"\"}}]', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('586', null, '序列号商品测试', '', null, null, 'xlh123', '', '', '个', '', null, null, null, null, null, null, null, '[{\"basic\":{\"Unit\":\"\",\"EnableSerialNumber\":\"1\"}},{\"other\":{\"Unit\":\"\"}}]', '', '', '', '', '1', '63', '0');
INSERT INTO `jsh_material` VALUES ('587', null, '商品test1', '', null, null, '', 'test1', '', '个', '', null, null, null, null, null, null, null, '[{\"basic\":{\"Unit\":\"\",\"EnableSerialNumber\":\"0\"}},{\"other\":{\"Unit\":\"\"}}]', '', '', '', '', '0', '63', '0');
INSERT INTO `jsh_material` VALUES ('564', '14', '商品1', '', null, 'sp1', '', '', '个', '', null, '', '', '', '', '0', '1', '0');
INSERT INTO `jsh_material` VALUES ('565', '14', '商品2', '', null, 'sp2', '', '', '个', '', null, '', '', '', '', '1', '1', '0');
INSERT INTO `jsh_material` VALUES ('566', '15', '商品666', '', null, 'sp666', '', '', '个', '', null, '', '', '', '', '0', '117', '0');
INSERT INTO `jsh_material` VALUES ('567', null, '商品1', '', null, 'dsp1', '', '', '个', '', null, '', '', '', '', '0', '115', '0');
INSERT INTO `jsh_material` VALUES ('568', '17', '商品1', '', '100.000000', 'sp1', '', '', '个', '', null, '', '', '', '', '0', '63', '0');
INSERT INTO `jsh_material` VALUES ('569', '17', '商品2', '', '200.000000', 'sp2', '', '', '只', '', null, '', '', '', '', '0', '63', '0');
INSERT INTO `jsh_material` VALUES ('570', '17', '商品3', '', '300.000000', 'sp3', '', '', '个', '', null, '', '', '', '', '0', '63', '0');
INSERT INTO `jsh_material` VALUES ('571', null, '商品4', '', null, 'sp4', '', '', '', '', '15', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('572', null, '234234', '', null, '234234', '', '', '', '', null, '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('573', null, '12312', '', null, '12', '', '', '', '', null, '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('574', null, '商品5', '', null, '213qw', '', '', '个', '', null, '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('575', null, '商品6', '', null, 'sp6', '', '', '', '', '15', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('576', null, '商品7', '', null, 'sp7', '', '', '', '', '15', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('577', null, '商品8', '', null, 'sp8', '', '', '', '', '15', '', '', '', '', '0', '63', '0');
INSERT INTO `jsh_material` VALUES ('578', '17', '商品9', '', null, 'sp9', '', '', '', '', '15', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('579', null, '商品17', '', null, 'sp17', '', '', '', '', '15', '', '', '', '', '0', '63', '0');
INSERT INTO `jsh_material` VALUES ('580', null, '15', '', null, '15', '', '', '', '', '15', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('581', null, '16', '', null, '16', '', '', '', '', '15', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('582', null, '商品20', '', null, 'sp2', '', '', '个', '', null, '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('583', null, 'wer', '', null, 'rqwe', '', '', '', '', '15', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('584', null, 'sfds', '', null, 'a2233', '12', '2', 'ge', '', null, '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('585', null, 'asdf', '', null, 'adsfasdf', '', '', '', '', '15', '', '', '', '', '0', '63', '1');
INSERT INTO `jsh_material` VALUES ('586', null, '序列号商品测试', '', null, 'xlh123', '', '', '个', '', null, '', '', '', '', '1', '63', '0');
INSERT INTO `jsh_material` VALUES ('587', null, '商品test1', '', null, '', 'test1', '', '个', '', null, '', '', '', '', '0', '63', '0');
-- ----------------------------
-- Table structure for jsh_materialcategory
......
......@@ -771,3 +771,17 @@ INSERT INTO `jsh_functions` VALUES (245,'000107', '插件管理', '0001', '/page
-- 给商品扩展表增加 是否默认基础单位 字段
-- ----------------------------
alter table jsh_material_extend add default_flag VARCHAR(1) DEFAULT 1 COMMENT '是否为默认单位,1是,0否' after low_decimal;
-- ----------------------------
-- 时间:2020年05月04日
-- by jishenghua
-- 删除商品表的多价格相关的字段
-- ----------------------------
alter table jsh_material drop Packing;
alter table jsh_material drop RetailPrice;
alter table jsh_material drop LowPrice;
alter table jsh_material drop PresetPriceOne;
alter table jsh_material drop PresetPriceTwo;
alter table jsh_material drop FirstOutUnit;
alter table jsh_material drop FirstInUnit;
alter table jsh_material drop PriceStrategy;
\ No newline at end of file
......@@ -331,10 +331,10 @@ public class MaterialController {
objs[2] = m.getModel();
objs[3] = m.getSafetystock() == null? "" : m.getSafetystock().toString();
objs[4] = m.getUnit();
objs[5] = m.getRetailprice() == null ? "" : m.getRetailprice().toString();
objs[6] = m.getLowprice() == null ? "" : m.getLowprice().toString();
objs[7] = m.getPresetpriceone() == null ? "" : m.getPresetpriceone().toString();
objs[8] = m.getPresetpricetwo() == null ? "" : m.getPresetpricetwo().toString();
objs[5] = "";
objs[6] = "";
objs[7] = "";
objs[8] = "";
objs[9] = m.getRemark();
objs[10] = m.getEnabled() ? "启用" : "禁用";
objects.add(objs);
......
......@@ -36,6 +36,8 @@ public class DepotItemVo4WithInfoEx extends DepotItem{
private String priceStrategy;
private BigDecimal purchaseDecimal;
private String barCode;
public Long getMId() {
......@@ -166,6 +168,14 @@ public class DepotItemVo4WithInfoEx extends DepotItem{
this.priceStrategy = priceStrategy;
}
public BigDecimal getPurchaseDecimal() {
return purchaseDecimal;
}
public void setPurchaseDecimal(BigDecimal purchaseDecimal) {
this.purchaseDecimal = purchaseDecimal;
}
public String getBarCode() {
return barCode;
}
......
......@@ -6,91 +6,25 @@ import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface MaterialMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_material
*
* @mbggenerated
*/
int countByExample(MaterialExample example);
long countByExample(MaterialExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_material
*
* @mbggenerated
*/
int deleteByExample(MaterialExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_material
*
* @mbggenerated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_material
*
* @mbggenerated
*/
int insert(Material record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_material
*
* @mbggenerated
*/
int insertSelective(Material record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_material
*
* @mbggenerated
*/
List<Material> selectByExample(MaterialExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_material
*
* @mbggenerated
*/
Material selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_material
*
* @mbggenerated
*/
int updateByExampleSelective(@Param("record") Material record, @Param("example") MaterialExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_material
*
* @mbggenerated
*/
int updateByExample(@Param("record") Material record, @Param("example") MaterialExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_material
*
* @mbggenerated
*/
int updateByPrimaryKeySelective(Material record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_material
*
* @mbggenerated
*/
int updateByPrimaryKey(Material record);
}
\ No newline at end of file
......@@ -47,10 +47,6 @@ public interface MaterialMapperEx {
int findBySelectWithBarCodeCount(@Param("q") String q);
int updatePriceNullByPrimaryKey(Long id);
int updateUnitIdNullByPrimaryKey(Long id);
List<MaterialVo4Unit> findByAll(
@Param("name") String name,
@Param("model") String model,
......
......@@ -186,12 +186,6 @@ public class MaterialService {
material.setId(id);
try{
materialMapper.updateByPrimaryKeySelective(material);
Long unitId = material.getUnitid();
if(unitId != null) {
materialMapperEx.updatePriceNullByPrimaryKey(id); //将价格置空
} else {
materialMapperEx.updateUnitIdNullByPrimaryKey(id); //将多单位置空
}
JSONObject mObj = JSON.parseObject(beanJson);
materialExtendService.saveDetials(mObj.getString("inserted"),mObj.getString("deleted"),mObj.getString("updated"),mObj.getString("sortList"),id);
if(mObj.get("stock")!=null) {
......@@ -435,8 +429,8 @@ public class MaterialService {
String manyUnitAll = unit + "," + manyUnit + "(1:" + ratio + ")";
Long unitId = unitService.getUnitIdByName(manyUnitAll);
m.setUnitid(unitId);
m.setFirstoutunit(unit); //首选出库单位
m.setFirstinunit(manyUnit); //首选入库单位
//m.setFirstoutunit(unit); //首选出库单位
//m.setFirstinunit(manyUnit); //首选入库单位
JSONArray arr = new JSONArray();
JSONObject basicObj = new JSONObject();
basicObj.put("Unit", unit);
......@@ -456,13 +450,13 @@ public class MaterialService {
otherObjEx.put("other", otherObj);
arr.add(basicObjEx);
arr.add(otherObjEx);
m.setPricestrategy(arr.toJSONString());
//m.setPricestrategy(arr.toJSONString());
} else {
m.setUnit(unit);
m.setRetailprice(parseBigDecimalEx(retailPrice));
m.setLowprice(parseBigDecimalEx(lowPrice));
m.setPresetpriceone(parseBigDecimalEx(presetpriceone));
m.setPresetpricetwo(parseBigDecimalEx(presetpricetwo));
//m.setRetailprice(parseBigDecimalEx(retailPrice));
//m.setLowprice(parseBigDecimalEx(lowPrice));
//m.setPresetpriceone(parseBigDecimalEx(presetpriceone));
//m.setPresetpricetwo(parseBigDecimalEx(presetpricetwo));
}
String enabled = ExcelUtils.getContent(src, i, 12); //状态
m.setEnabled(enabled.equals("1")? true: false);
......
......@@ -38,8 +38,7 @@
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
<result column="UName" jdbcType="VARCHAR" property="UName" />
<result column="MColor" jdbcType="VARCHAR" property="MColor" />
<result column="PresetPriceOne" jdbcType="DECIMAL" property="presetPriceOne" />
<result column="PriceStrategy" jdbcType="VARCHAR" property="priceStrategy" />
<result column="purchase_decimal" jdbcType="DECIMAL" property="purchaseDecimal" />
</resultMap>
<resultMap id="ResultStockWarningCount" type="com.jsh.erp.datasource.vo.DepotItemStockWarningCount">
......@@ -149,11 +148,13 @@
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial">
select m.id MId, m.Name MName, m.Model MModel, m.Unit MaterialUnit, m.Color MColor,
m.PresetPriceOne, m.PriceStrategy, u.UName UName
me.purchase_decimal, u.UName UName
from jsh_depotitem di
inner join jsh_material m on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
where 1=1
and me.default_flag=1
<if test="headIds != null">
and di.HeaderId in (${headIds})
</if>
......@@ -161,7 +162,7 @@
and di.MaterialId in (${materialIds})
</if>
and ifnull(di.delete_Flag,'0') !='1'
group by m.id,m.Name, m.Model, m.Unit, m.Color, m.PresetPriceOne, m.PriceStrategy, u.UName
group by m.id,m.Name, m.Model, m.Unit, m.Color, me.purchase_decimal, u.UName
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
......
......@@ -116,23 +116,6 @@
and ifnull(m.delete_Flag,'0') !='1'
</select>
<update id="updatePriceNullByPrimaryKey" parameterType="java.lang.Long">
update jsh_material
set
RetailPrice = null,
LowPrice = null,
PresetPriceOne = null,
PresetPriceTwo = null
where Id = #{id,jdbcType=BIGINT}
</update>
<update id="updateUnitIdNullByPrimaryKey" parameterType="java.lang.Long">
update jsh_material
set
UnitId = null
where Id = #{id,jdbcType=BIGINT}
</update>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
select m.*,u.uname unitName, mc.name categoryName
FROM jsh_material m
......@@ -164,9 +147,8 @@
<select id="getMaterialEnableSerialNumberList" parameterType="java.util.Map" resultMap="com.jsh.erp.datasource.mappers.MaterialMapper.BaseResultMap">
select
Id, CategoryId, name, Mfrs, Packing, SafetyStock, Model, Standard, Color, Unit, Remark,
RetailPrice, LowPrice, PresetPriceOne, PresetPriceTwo, UnitId, FirstOutUnit, FirstInUnit,
PriceStrategy, Enabled,enableSerialNumber
Id, CategoryId, name, Mfrs, SafetyStock, Model, Standard, Color, Unit, Remark,
UnitId, Enabled,enableSerialNumber
FROM jsh_material
where 1=1
and enabled ='1'
......
Supports Markdown
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